triggering a filtering on click?

triggering a filtering on click?

jeanjean Posts: 12Questions: 5Answers: 0
edited August 2009 in General
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

Replies

  • allanallan Posts: 61,663Questions: 1Answers: 10,095 Site admin
    Hi jean,

    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
This discussion has been closed.