Skip state save in particular cases
Skip state save in particular cases
xtech_dev
Posts: 25Questions: 11Answers: 0
Hello,
I have read documentation about stateSave callback's. Is there any way to cancel state saving i particular cases.
I mean something like:
var allowToSaveState = false;
var dt = $('#example').dataTable( {
"stateSave": true,
"stateSaveParams": function (settings, data) {
return allowToSaveState;
}
});
dt.state.save() // save should be skipped
allowToSaveState = true;
dt.state.save() // save should be preformed
How to make it work?
I'm using DataTables 1.10.18
It Man
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
You need to delete the items you don't want from the
data
object - e.g.:Allan
Will it stop saving (storage not touched) or only prevent from saving particular state components?
This.
There isn't currently a way to stop it saving if state saving is enabled (also, even if there was, the last state that was saved would still be present).
Allan