Individual column searching - How to keep selected filter after reload the page?
Individual column searching - How to keep selected filter after reload the page?
mariozupan
Posts: 4Questions: 1Answers: 0
How to keep selected filter after reload the page, in this example https://datatables.net/examples/api/multi_filter_select.html?
This discussion has been closed.
Answers
have you tried turning the statesave option to true?
so:
hope that helps/works. I think the standard time is 2 hours but this can also be modified.
https://datatables.net/reference/option/stateSave
statesave (or bstatesave) saves the state, but page refresh removes the selected filter value, so I got correct data in datatable, but wrong filter value, ie. empty string.
you can allways use my yadcf filter, it support state saving out of the box for all its filter types, see showcase
@daniel_r
Ugh I can't believed I missed your addon when I was looking for one. I wound up making my own:
@daniel_r I tried the yadcf plugin 0.8.8.
Refresh of the page reset filter value, so the user have to set filter again. "statesave" saves the filtered data, but reset the filter value.
yadcf 0.8,9 seems to act properly on the site, but I can't see the download link for that version
thank you on your help
yadcf can be downloaded from its github repository
Here are the link to the raw files
yadcf latest js
yadcf latest css
DataTables knows nothing about the filter inputs - it knows only that its API has been called and it should filter the table accordingly.
So if you want to use something like the example on this site with state saving you'd need to use
stateLoadParams
to fill them back in. Alternatively use YADFC which does this for you.Allan
@allan Could you please add the code to the example https://datatables.net/examples/api/multi_filter_select.html
I will try to make some time in the new year to do so.
Allan