Page Refresh Clears Selected with stateSave = true
Page Refresh Clears Selected with stateSave = true
ayz
Posts: 63Questions: 23Answers: 1
When I refresh the browser page with my datatable, the selected items become unselected.
Is this the right behaviour or something definitely wrong with my code?
This question has accepted answers - jump to:
This discussion has been closed.
Answers
Hi @ayz ,
Yep, that's the expected behaviour. Some things can be preserved if
stateSave
is enabled, such as column ordering and filtering, but not the selection I'm afraid.Cheers,
Colin
It would be possible to add the selection via the
stateSaveParams
option andstateLoadParams
. Its possible that is something that Select should do out of the box - I've added it to the list.Thanks for the suggestion,
Allan
Slated for a release to come soon or...?
To come. I don't think it will be soon though I'm afraid - we've got a bit of a back log at the moment .
Allan
Hi @ayz ,
I just got that
stateSave
and Select working together. Take a look at this example here. Would this work for you?Cheers,
Colin
Wow, that's fantastic. Meaning I need to use a nightly build in production or something? And will work with any config of select e.g. 'multi' etc etc?
Also if I'm using a 3rd party control, like kendoUI datepicker, would this automatically save the value which is obtained indirectly by calling .data("kendodatepicker").value() type notation?
Ah no, not dependent upon nightly, you can just shove your own library versions in there, that's just what the demos use by default. This will currently work with all row selections, whether single or multi, so that will be covered. The Selection extension also supports column and cell selection, it would be a trivial addition to support that if required.
I'm not sure about datepicker - my demo just notes which rows have been selected, and adds that to the data that stateSave currently stores. If datapicker is needed somewhere, it'll be trivial to add that to saved information.
Cheers,
Colin