Introducing StateRestore

Introducing StateRestore

sandysandy Posts: 805Questions: 0Answers: 216

I'm excited to announce the first release of our latest extension for DataTables: StateRestore.

Building on the stateSave initialisation option, StateRestore allows users to save multiple different states and restore them at any time, reverting the table back to how it was when the state was saved. You can also easily set which elements of DataTables are saved to a state on a state by state basis. There is a wide range of other options and examples showing what StateRestore can do.

StateRestore is available on our CDN via our download builder or direct file access, also on NPM / Yarn, NuGet, Composer and bower (see the download builder for details). The manual is available here including details on how to customise which elements of DataTables to save.

As always, we would welcome any feedback that you have! If you have any suggestions, please post them here. If you run into any issues, please let us know by creating a new thread with a test case, so we can keep track of individual issues.

Hopefully StateRestore can add some value to your projects!



  • setwebmastersetwebmaster Posts: 76Questions: 5Answers: 0

    Hi there :smile:

    Nice work on this extension, I will try to replace StateSave with it in the following days.

    One question I would have would be if it is possible to use StateRestore without generating any button?
    I already have my UI elements that I use with StateSave and would like to simply swap the calls to the new api instead of StateSave if possible.

  • setwebmastersetwebmaster Posts: 76Questions: 5Answers: 0

    @sandy would you have an answer to the question above?

  • colincolin Posts: 13,295Questions: 0Answers: 2,272

    Sorry, we missed that message, but yep, as you can see in this example you can use the API to create and load states, and the buttons don't need to be present for that to happen.


  • setwebmastersetwebmaster Posts: 76Questions: 5Answers: 0

    @colin Thanks for the reply. I had seen the example you linked to, but it is using both the api AND the buttons so that's why I was asking.

    When I tested it, there were errors trying to access the table.stateRestore.state($('#state-selector').<function> so I assumed it was because the buttons had not been initialized and there might be a problem in the overall StateRestore initialization process due to that.

    Is there any example of using the api only without initializing the StateRestore buttons? As all the references I found were initializing it via the "CreateState" button at the very least...

    Thanks in advance! :smile:

  • colincolin Posts: 13,295Questions: 0Answers: 2,272

    @setwebmaster Apologies for the late reply, I missed your question. There isn't an example currently, but I just created one (initialisation/noButtons) which will be on the site when StateRestore is next released.


  • setwebmastersetwebmaster Posts: 76Questions: 5Answers: 0
    edited January 28

    @colin awesome, do we have a rough estimate of when that could be? (days, weeks, months?)

    *TBN: I have read the example directly from Gtihub and will try to implement it the same and see if there are differences that justify it didn't work on my case (maybe beacause I'm using Searchpanes, which is "incompatible" with StateRestore as of now if I remember correctly, but I didn't think it could be "breaking" StateRestore features ahah, I will have to test and report back :smile: )

    Thanks again and keep on with the great work that's being done on DataTables!

Sign In or Register to comment.