Accessing filter information from multiple dataTables on same page

Accessing filter information from multiple dataTables on same page

jackdinfljackdinfl Posts: 1Questions: 0Answers: 0
edited February 2013 in General
Debugger code: ekamut

I have six uniquely-named dataTables on one page, with each table on a separate jQuery tab. Each row in each table has an on click handler that takes the user to a form where they can edit the information about the item represented in that row. With the form there is a 'back' button that returns them to the dataTable view.

What I need to accomplish when the user returns to the dataTable view is to restore the filter conditions that were in effect when they clicked away from the table. The solution I'm using is to save $('.dataTables_filter input').val() to a cookie when they click away, then use oTable.fnFilter($.cookie('filter')) to restore the filter condition when they return.

My code works, but only for the first of the six dataTables. For the first table, $('.dataTables_filter input').val() returns a valid value. For all the other five dataTables, its value either stays the same no matter what is typed in the search input, or it returns null. Any insights on what might be going wrong will be greatly appreciated.
This discussion has been closed.