I am stuck and don't know how to solve it.

I am stuck and don't know how to solve it.

gabrialgabrial Posts: 3Questions: 1Answers: 0

Link to test case: http://live.datatables.net/pevowuca/1/edit
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:

Hi,

 I am trying to do the following and categorized into working and non working  

a) Working

1) table

2) default responsive

3) default sorting

4) default search

b) Not Working

1) trying to add a column search on the 2nd row in the header like name, start date and salary

( Also I don't know how to mention the selected column headers ike name, start date and salary)

2) trying to add a column select search on the 3rd row in the header like position, office and age.

( Also I don't know how to mention the selected column headers like position, office and age.)

Please any kind help ?

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    This line here:

      $('#example thead tr:eq(3) th').each( function () {
    

    is saying you want the select in the fourth header row (counting starts from 0) but you've only got a single row in your header. These two examples, here and here, should get you going,

    Colin

  • gabrialgabrial Posts: 3Questions: 1Answers: 0

    Hi,

        I make the suggested change for thead rows from 3 to 2 and 2 to 1.
    

    Is there any alteration work will help to go with the current code at http://live.datatables.net/pevowuca/3/edit ?

    Or need to implant the two example suggested by Mr. Colin ?

    Any kind solution or help ?

  • gabrialgabrial Posts: 3Questions: 1Answers: 0

    Hi,

       As per the two suggestions of two examples at
    

    1) https://datatables.net/examples/api/multi_filter.html

    2) https://datatables.net/examples/api/multi_filter_select.html

    make a change as follows at

    http://live.datatables.net/pevowuca/3/edit

    but the table not working ?

    I don't know the reason.

    Any kind solution or help ?

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    The code has many errors in it - look at the console.

    Also, lines like these:

          this.api().columns().every( function () {
    

    do something to every column, but you said you only wanted dropdowns of input elements on specific columns, so you'll need to specify them.

    And like before, you only have the single thead element in the HTML, so there's nothing to add those elements on to.

    This example here might help - there's three header columns - but you look at the code to get an idea of the structure: http://live.datatables.net/tobekuxu/1/edit

    Colin

Sign In or Register to comment.