We really like the new Undo/Redo functionality.
We have done some testing on the feature and find that it is handling pretty much all of the events we would expect - however one case did come up.
We have added a feature that utilizes the moveTask (followed by updateTask) method to make a task become the child task of another task (or push it back out to be the same level as it’s parent). We can see that the a command gets added to the Undo Stack just fine, but the command appears to be incorrectly storing current parent value in the OldValue - so there is no way to undo it to it’s previous state.
Could we manually add our change to the Stack? Is this a bug? Are we doing something unsupported?
Hello,
you can get undo stack any time programmatically and modify it’s contents:
github.com/DHTMLX/gantt/blob/v4 … ndo.js#L17
docs.dhtmlx.com/gantt/api__gantt … stack.html
Or, you can capture event that fired when undo is called:
It takes an action object as an argument and you can either modify it or perform needed changes yourself and cancel the default processing by returning ‘false’ from an event handler
github.com/DHTMLX/gantt/blob/v4 … ndo.js#L75
docs.dhtmlx.com/gantt/api__gantt … event.html - seems like the event argument is missing from the api reference
Hopefully these methods should be enough to override the behavior of undo/redo in desired way.
We’ll also mark this issue and will investigate it from our side in the nearest time