Two StateRestore bugs - 1) Interaction with colVis, 2) remove all buttons

Two StateRestore bugs - 1) Interaction with colVis, 2) remove all buttons

bugreports999bugreports999 Posts: 3Questions: 0Answers: 0

Link to test case:
https://jsfiddle.net/3256n9bz/
Debugger code (debug.datatables.net):
N/A
Error messages shown:
N/A
Description of problem:
This is a bug report for two separate issues:

Bug 1) StateRestore's interaction with colVis.

a) Load the above jsfiddle.
b) Drag the Age column to be the first column. **** Note that this moves the Age column past a hidden column (the Office column is hidden)****.
c) Press Create State to create "State 1". ****Note that the Position column is visible, and the Office column is hidden***.
d) Press Saved States and press "State 1".
e) The Office column now becomes visible, and Position becomes hidden. This is a bug as the state should not change.

For additional reference I can add that this bug only happens with the StateRestore plugin. It does not happen with the stateSaveCallback and stateLoadCallbacks. I didn't provide code to show this, but that's my experience in other projects.

Bug 2) Remove all states button does not remove all states.
a) Load the above jsfiddle.
b) Press Create State 3 or more times.
c) Verify that 3 or more states have been created by pressing the Saved States button.
c) Press the "Remove all states" button.
e) By pressing the "Saved states" button, you will now see that there are still states left.

Replies

  • sandysandy Posts: 913Questions: 0Answers: 236

    Hi @bugreports999 ,

    For your first point, as listed in the compatibility chart StateRestore is not compatible with ColReorder. This is something that we intend to add support for in the future, but for now it is not supported.

    For your second point I agree, something isn't right there. I've raised an issue internally (DD-2468 for my reference) and will report back here when there is an update. If not by the end of today then it will be the end of next week probably.

    Thanks,
    Sandy

  • bugreports999bugreports999 Posts: 3Questions: 0Answers: 0

    Thanks, @sandy. I wasn't aware of the incompatibility between ColReorder and StateRestore, but I look forward to getting that supported sometime in the future. For reference, I ended up building a custom solution that 1) annotates any state saved through state restore with a boolean saying that columns should be permuted when loading the data, and 2) in stateLoadParams checks for this boolean and if it's there, it permutes the columns array according to the ColReorder array. This seems to work.

    And thanks for confirming the second item as a bug.

  • sandysandy Posts: 913Questions: 0Answers: 236
    edited March 2022

    Hi @bugreports999 ,

    Apologies for the delay in getting this fixed. That should be the issue fixed now. 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

Sign In or Register to comment.