State save on initialization
State save on initialization

https://datatables.net/forums/discussion/47645/state-saving-during-initialization
This gentlemen asked a question here and I do not see a response to the question, only that the discussion was closed.
I have a similar problem where I am loading state from another source. I also save the state in another location, and want to trigger an action when the state saves. The problem is that when DataTables initially loads, it loads the state and then immediately saves it right after. This creates a situation where it seems like the user has changed something because the state save function has been called, but in actuality no changes were made by the user.
Is there a way for me to check if the state save is from the initial load or from a user changing something?
Any help is appreciated.
Answers
Actually it seems like the state is saved multiple times during initialization - is that correct?
What happens is that DataTables triggers a state save on every draw, regardless of what has changed. So yes, when a state is loaded and then a draw is triggered to display those changes, it will result in that state being saved again. I do acknowledge that is a bit redundant.
Are you just trying to save that extra call? Could you put a flag into your load / save functions to say that on load, set the flag and then on save if the flag is set, just reset it and return?
Allan
Yes I supposed that would be a work around.
Essentially what I'm doing is loading/saving preset views (states) from a db. I have a UI element that shows whether the user has made changes to the state and enables a button to persist if they have.
Right now when the page loads, it loads the state they have selected and then the table redraws I guess and that triggers a state save, which the UI then picks up as the user making changes.
Does a redraw also trigger a reorder event?