Bug: With stateSave true, search column, return to page & column input is blank but still filter
Bug: With stateSave true, search column, return to page & column input is blank but still filter
Problem:
Bug: With stateSave true, search column, return to page & column input is blank but still filtered
Link to test case: https://codepen.io/sfauch1/pen/YGWGyN?editors=1010
I'm able to create this same problem, not just in codepen, but also in my local and production servers. But this codepen is useful to illustrate the problem without other variables in the way.
Description of problem / How to Recreate Problem:
- Go to the codepen above
- Change the initialization of Datatable to this, at line 9, by adding stateSave is true:
// DataTable
var table = $('#tbAdresse').DataTable({stateSave: true});
- Now, in the Search Position column, type into the search "System" and press Enter
- See that there are 3 rows result
- Now, Refresh the browser page
- The datatable initialize is back to the default, add again to line 9, that stateSave is true
- Wait for the lower pane to self refresh after the JS change
- See that the column Search for Position is blank, but it is still showing 3 results of System
Thoughts?
- Can this be officially fixed?
- This problem was already seen years ago in previous versions.
- Or, did I miss the fix somewhere?
Thank you!
This question has an accepted answers - jump to answer
Answers
The search inputs are not created nor controlled by Datatables. Custom code is used to create them. As such their state is not saved or restored by Datatables. There are some links to threads that might help you use
stataLoadParams
to update the inputs in this thread.Kevin
Thanks!
If I could change the title of this post, I would, since it isn't a bug.