Skip to main content

onAfterUndoStackChange

Description​

Fires when the undo or redo stack changes

onAfterUndoStackChange: (undoLength: number, redoLength: number) => void

Parameters​

  • undoLength - the number of actions on the undo stack
  • redoLength - the number of actions on the redo stack

Example​

gantt.attachEvent("onAfterUndoStackChange", function (undoLength, redoLength) {
document.getElementById("undo-button").disabled = undoLength === 0;
document.getElementById("redo-button").disabled = redoLength === 0;
});

Details​

Requires the undo plugin. Use the event to update command availability after recording, undoing, redoing or clearing actions.

Need help?
Got a question about the documentation? Reach out to our technical support team for help and guidance. For custom component solutions, visit the Services page.