Destroy option does not reset search or pagination state.
Destroy option does not reset search or pagination state.
I have a popup modal that renders a table with id #Foo. I initialize the plugin using $('#Foo').DataTables({ destroy: true, [other options] }). As I navigate in my modal, the content is replaced with another table. The plugin is then reinitialized in the exact same way (using the same ID and options). This seems to work (no duplicate initialization warnings), however, the new table still is set to search and pagination state of the first. For example, if in the first table, I searched for "Bar" and then went to page 2, the second table loads in the exact same state, with "Bar" in the search box and navigated to page 2, even though it is a completely different table element, initialized later, and with totally different rows/columns.
I have been trying to test the api destroy call, but so far have been unable to get that to work either.
Replies
So, it seems that this is a designed feature: https://datatables.net/reference/option/stateSave... Why would an explicit destroy not also reset table state?