"AND" Filtering by Drop-Down and Filter input box

"AND" Filtering by Drop-Down and Filter input box

andrewbeeandrewbee Posts: 3Questions: 0Answers: 0
edited March 2012 in General
Hi,

First let me say that Datatables is awesome, and an amazing functional enhancement for our product.

We have the normal filtering using the input box, and we have implemented filtering using a drop-down list. Both work fine - on their own. But, we want them to work together, so that if someone has filtered using the input box, and then we call fnFilter when the dropdown changes, we filter within the subset that's there instead of the entire table contents. In other words, the two search terms are "AND"ed together, not "OR"ed.

Does anyone have ideas of how to implement this? I've done some research on regular expressions to pass to fnFilter, but have not found one that works yet.

Thanks

Replies

  • andrewbeeandrewbee Posts: 3Questions: 0Answers: 0
    I figured it out: you just have to pass the column number when you call fnFilter(). Datatables then keeps the column filter applied when you type something in the main filter text box.
This discussion has been closed.