StateRestore savedStates button display active state counter
StateRestore savedStates button display active state counter
![ctml](https://secure.gravatar.com/avatar/c64a4fe5564feb1167c4f131595ce5c2/?default=https%3A%2F%2Fvanillicon.com%2Fc64a4fe5564feb1167c4f131595ce5c2_200.png&rating=g&size=120)
Not an issue but rather a small feature request. It would be a nice option to have the d% token available for the savedStates button to represent the current number of active states. Similar to the stateRestore button which supports it but instead represents the total number of states available. This would be in line with the other buttons (e.g. searchPanes) which allow for the place holder to be inserted when filters are added.
https://datatables.net/reference/option/language.buttons.savedStates
https://datatables.net/reference/option/language.buttons.stateRestore
There is an example showing the use of a label, but for consistency purposes with the other buttons my preference would be to show a counter on the button. I'm using savedStatesCreate in my case.
https://datatables.net/extensions/staterestore/examples/customisation/activeLabel.html
PS: This is a fantastic extension that opens up a lot of possibilities for end users, absolutely love it.
Also there is no category on the forum under extensions for "State Restore" yet.
This question has an accepted answers - jump to answer
Answers
Hi @ctml ,
Thanks for the suggestion. I can see the use case for this so I've raised an issue internally (DD-2422 for my reference) and will report back here when there is an update. I don't think we will make this the default but we can certainly make it available as an option.
Thanks,
Sandy
Oh and you should also notice that there is now a StateRestore category!
Thanks,
Sandy
Great, thanks a lot @sandy!
Hi @ctml ,
I've just pushed a fix for this now. We are going to add an example for how to do this in the next release, which you can see here. This will be available in the next StateRestore release which we hope will be in the next few weeks. Until then you can access the fix from the nightly builds.
Thanks,
Sandy