stateRestore not properly creating more than 1 state

stateRestore not properly creating more than 1 state

trongarttrongart Posts: 222Questions: 51Answers: 0

I have a very strange issue with stateRestore:

In my project, I am using stateRestore with Ajax source and the Ajax function as described here. The table and states data are stored on a database and are loaded and saved via php. This all works fine.

However, if a new state is created via the State Save buttons collection and previous states are present, The "Create New State" dialog does not close. It gives the following error:
Uncaught TypeError: Cannot read properties of undefined (reading 'node')
which is caused by that._collectionRebuild(); on line 1042 of stateRestore.js

Strangely, the state is still correctly saved in the database for me and is present in the Saved States button collection if I just click on X to manually exit the dialog after I click on Create.

If it is the very first state and no other states are present, everything works fine.

I created an analog test case with the datatables example data here:

Once loaded, click on Delete All and create the first state. This will work, and then create a second state and the "Create New State" dialog won't close. If you close it manually, the new state will still be there in the buttons collection.

What do you think is wrong here?


Sign In or Register to comment.