Possible bug: "stateLoaded.dt" does not fire
Possible bug: "stateLoaded.dt" does not fire
Link to test case: https://jsfiddle.net/c8muhr3w/
Debugger code (debug.datatables.net): etirud
Error messages shown: None
Description of problem:
In this example I am calling the stateLoaded.dt event:
dt.on('stateLoaded.dt', function (e, settings, data) {
console.log("test"); // Does not log
});
The console log never fires. I am on datatables 2.1 Is there a new event that replaces this one or is this just broken?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
First you need to enable
stateSave. You also need to instantiate the event before initializing Datatables so it will fire during initialization when the state is loaded. Updated test case:https://jsfiddle.net/t5jsvxbh/
Kevin