JQuery DataTables - Remove fnFilter and display all results

JimmyJammed picture JimmyJammed · Dec 7, 2011 · Viewed 38.9k times · Source

I current have a datatable that has a button for each record that when clicked displays other information for that account. When this happens, I call fnFilter() to filter that specific row so that no other ones are displayed and the user knows that the sub-information I display is for that specific account. What I would like to do, is when a user clicks back in the search toolbar, it hides the sub-information I displayed, then clears the filter and shows all the original records available. Everything works fine, except that the filter doesnt get cleared so only the originally selected row is still displayed.

Not sure what I am missing. I have tried everything from using fnFilter(''), to fnDraw(), to fnReloadAjax(). None of these (or any combination) seem to work!

UPDATE

Answer

JimmyJammed picture JimmyJammed · Dec 7, 2011

Ah I seemed to have figured it out. Have to clear out the filter on that specific column AND the global filter:

oTable.fnFilter('',7);
oTable.fnFilter('');