stateRestore - Bug with similar states (not equal states), multiple states show active
stateRestore - Bug with similar states (not equal states), multiple states show active
![glimpsed_chaos](https://secure.gravatar.com/avatar/c74f024f08cc3aa36c18bb85b65ed3c0/?default=https%3A%2F%2Fvanillicon.com%2Fc74f024f08cc3aa36c18bb85b65ed3c0_200.png&rating=g&size=120)
Link to test case: https://live.datatables.net/kufogowi/1/edit
Description of problem: My test case is just to prove it out / recreate the problem. I have steps for recreating the problem there as well.
Essentially, if you create a state such as ordering by a column, then create another state that orders by the same column and an additional column then click Saved States, you can see it show BOTH states as active.
This should not be, since these are two different states.
I noticed this with SearchPanes active and trying to create different states with selections for a pane.
This can be recreated on the SearchPanes example as well by selecting "Chief Executive Officer", save state. Then selecting "Chief Executive Officer" and "Customer Support", save the state. Open the Saved States and see both states are active. -https://datatables.net/extensions/staterestore/examples/integration/preDefinedSearchPanes.html
Even the most basic example does this - https://datatables.net/extensions/staterestore/examples/initialisation/simple.html
This should mean there is a problem with the core stateRestore and not just something in the SearchPane usage.
This question has accepted answers - jump to:
Answers
Apologies for bumping. But hoping to get some traction on what may be a bug or at least unintended behavior and how to resolve if possible.
Hi,
Sorry for the delay in replying here! I agree, there is an error in the state comparison. I'll look into it just now.
Allan
Fix committed here. The nightly will rebuild with the fix soon (you might need to add a cache busting query parameter), and the change will be in the next release.
Thanks for flagging this up and letting me know about it.
Allan