Invalid search options not to be restored
Invalid search options not to be restored
I cannot comment on the thread
https://datatables.net/forums/discussion/72231/invalid-searchpanes-options-should-not-be-restored-from-statesave#latest
anymore, so here's my answer.
Thank you very much for your fix, it works with storing in the HTML5 localStorage, but still behaves strangely when using stateSaveCallback
. I will try to setup a test case as soon as possible.
First thing I noticed is that the searchPanes.selectionList
doesn't seem to be included in the stateSaveParams
as you can see here:
http://live.datatables.net/coduluva/5/edit
(just select a filter)
Answers
Hi guys,
here is the final test case:
http://live.datatables.net/coduluva/6/edit
When selecting a random filter option and reloading the page, a JS error is thrown.
Only chance to 'reset' this error: Disable
stateLoadCallback
and reload the page.There is no way to get rid of the invalid filter option.
Many thanks - Sandy will take a look towards the end of the week when he is back.
Allan
Hi @pgerundt ,
SearchPanes uses the
stateSaveParams
event to add the SearchPanes data to the state object. This event listener is set after the one set in the datatables initialisation.I'd suggest that you set your listener after SearchPanes has initialised. You could set a listener inside the datatables
initComplete
option - at this point SearchPanes will have already set it's listener and yours should run after the options have been added.Thanks,
Sandy