This sample showcases the undo-redo functionality in the Gantt Chart, allowing users to revert or reapply their recent actions such as task edits, additions, and deletions.
The undo feature lets users reverse the most recent changes made to tasks, dependencies, columns, or timeline settings. The redo feature restores actions that were previously undone. Both can be triggered using keyboard shortcuts (Ctrl + Z for Undo, Ctrl + Y for Redo on Windows/Linux or Cmd + Z / Cmd + Shift + Z on Mac) or via toolbar buttons. You can configure which actions are tracked using the undoRedoActions property. Supported actions include: Edit, Add, Delete, Sorting, ColumnReorder, ColumnResize, Search, Filtering, ZoomIn, ZoomOut, ZoomToFit, ColumnState, Indent, Outdent, RowDragAndDrop, TaskbarDragAndDrop, PreviousTimeSpan, and NextTimeSpan The number of undo-redo steps stored can be controlled using the undoRedoStepsCount property, which defaults to 10. In this demo, the undo-redo feature is enabled by setting enableUndoRedo to true Injecting Module: Gantt component features are segregated into individual feature-wise modules. To use undo redo, filter, sort, column menu, resize, edit, reorder, context menu, toolbar, markers features, inject the UndoRedo, Filter, Sort, ColumnMenu, Resize, Edit, Reorder, ContextMenu, Toolbar, DayMarkers modules using the Gantt.Inject(UndoRedo), Gantt.Inject(Filter), Gantt.Inject(Sort), Gantt.Inject(ColumnMenu), Gantt.Inject(Resize), Gantt.Inject(Edit), Gantt.Inject(Reorder), Gantt.Inject(ContextMenu), Gantt.Inject(Toolbar) and Gantt.Inject(DayMarkers) methods. More information on the Essential® JS2 Gantt Chart can be found in this documentation section.