First time stateLoadCallback is called

First time stateLoadCallback is called

dominivisdominivis Posts: 2Questions: 1Answers: 0

I've got everything working fine for custom save and load state, but the first time stateLoadCallback is called I still don't have any data stored, because stateSaveCallback was not called yet.

How can I make stateSaveCallback be called first? Or what should I do on stateLoadCallback if I still have a null state?

Thanks in advance!

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599
    Answer ✓

    Hi @dominivis ,

    You can't change the ordering, that's fixed, but one option would be to call the callback with null on that first iteration, that would get the table loaded, something like:

        stateLoadCallback: function(settings, callback) {
          callback(null);
        },
    

    Hope that does the trick,

    Cheers,

    Colin

  • dominivisdominivis Posts: 2Questions: 1Answers: 0

    Thank you very much, after your tip I discovered that my problem was that I was returning an "undefined" and that doesn't work.

This discussion has been closed.