Possible bug: "stateLoaded.dt" does not fire

Possible bug: "stateLoaded.dt" does not fire

kbinlkbinl Posts: 4Questions: 1Answers: 0

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

Answers

  • kthorngrenkthorngren Posts: 21,213Questions: 26Answers: 4,929
    Answer ✓

    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

Sign In or Register to comment.