Multi Select Filter/Search issue. Is this possible with Datatables?

Multi Select Filter/Search issue. Is this possible with Datatables?

bensdbbensdb Posts: 30Questions: 4Answers: 0

Here is a link to a test table I had put together.

http://live.datatables.net/masakez/2/edit

As you can see I had put two selects at the top with different values from the table to act as a simple combo of filters. It works nicely, and I thought I was done but then realized there is some major functionality missing.

Say the user selects 'option2' in select 1, and 'active' in select 2, datatables then searches for the string 'option2 active' in the datatable and draws it. That's all when and good, but the problem is I need to search for all records with 'option2' in them, AND THEN from those records, which of those has 'active' in the column ADJACENT/NEXT to the column with in which 'option2' was found, for each row.

Does Databases have the functionality to do this? Any advice?

I'm guessing I have to search for 'option2' and then somehow get a column reference for that positive search result in each row, and then search in the next column over of that row.....don't know how though!

Any advice or pointers appreciated!

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,687Questions: 1Answers: 10,500 Site admin
    Answer ✓

    There are two options here:

    1. use orthogonal data for the filtering and the filter on the individual columns. Information on orthogonal data in DataTables can be found in the manual.
    2. The other option is to use a custom filter. I haven't updated the documentation for 1.10 yet, but the old style will still work.

    Allan

  • bensdbbensdb Posts: 30Questions: 4Answers: 0

    Allan=Legend

  • bensdbbensdb Posts: 30Questions: 4Answers: 0
    edited May 2014

    if anyone is interested here is a working example of this in action:

    http://live.datatables.net/masakez/5/edit

    It's not the most elegant js, as I'm sure a loop would do nicely in this situation, but I'm rubbish at js so can't don't want to spend the time making it more efficient

This discussion has been closed.