What exactly is saved when I save the state of a table?
What exactly is saved when I save the state of a table?
adinaadler
Posts: 6Questions: 0Answers: 0
I have some giant tables, and a lot of users who only care about certain sections of the tables. They love filterable columns, and I'm working on adding in some buttons to let people decide which columns to display and which to hide.
However, it's kind of tedious having to do the filtering and column-hiding every time you bring up the table. I see that there's the bStateSave parameter, and there's also fnStateLoad and fnStateSave, but I can't find a definition of what's saved and loaded in those things. Can I use those to store whether columns are displayed, and what all of my column filters are set to?
However, it's kind of tedious having to do the filtering and column-hiding every time you bring up the table. I see that there's the bStateSave parameter, and there's also fnStateLoad and fnStateSave, but I can't find a definition of what's saved and loaded in those things. Can I use those to store whether columns are displayed, and what all of my column filters are set to?
This discussion has been closed.
Replies
You can use fnStateSaveParams and fnStateLoadParams to alter the parameters that are saved / restored. This is the piece of code that does the saving in 1.9.4: https://github.com/DataTables/DataTables/blob/RELEASE_1_9_4/media/js/jquery.dataTables.js#L4393
Allan