What exactly is saved when I save the state of a table?

What exactly is saved when I save the state of a table?

adinaadleradinaadler Posts: 6Questions: 0Answers: 0
edited February 2014 in General
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?

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    This is part of the documentation that is lacking somewhat - apologies that you've stumbled across this.

    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
  • adinaadleradinaadler Posts: 6Questions: 0Answers: 0
    Thanks, that's exactly what I was looking for.
This discussion has been closed.