triggering a filtering on click?
triggering a filtering on click?
I am trying to trigger a filtering when the user click on a word.
I have one column with producer name for example, and when clicking on a word of that column, I'd like to simulate the action of typing that word in the search box.
I tried to both fill in the search box and doing a fnClearTable() and/or fnFilter("myname") but while I manage to reload the filtered data, the header/footer are messed up or duplicated
What would be the way to do that?
thanks,
jean
I have one column with producer name for example, and when clicking on a word of that column, I'd like to simulate the action of typing that word in the search box.
I tried to both fill in the search box and doing a fnClearTable() and/or fnFilter("myname") but while I manage to reload the filtered data, the header/footer are messed up or duplicated
What would be the way to do that?
thanks,
jean
This discussion has been closed.
Replies
fnFilter() is what you are looking for: http://datatables.net/api#fnFilter . If you pass the second parameter as an integer that will be used to filter the column. If you have a look at this example, it might help you get a handle on how this should be used: http://datatables.net/examples/api/multi_filter.html (note that you shouldn't reinitialise the table - which is what is causing the duplicated header/footer).
Regards,
Allan