Skip to main content
This page is based on source code analysis. Some UI details may vary depending on your version. Verify the behavior in your Gantt installation.

Prerequisites

  • A Gantt widget in Edit mode
  • Undo/redo is loaded automatically at Gantt startup — no additional configuration is required

How Undo and Redo Works

The Gantt maintains a history of changes made during an edit session. Each time you move a task bar, resize a task, or modify a value, the action is recorded. You can step backward through these changes with Undo and forward again with Redo.
SettingDefault ValueDescription
undo_steps10Maximum number of changes stored in the undo history
The undo history is cleared when you exit Edit mode or save your changes. diagram

Use the Undo and Redo Buttons

  1. Click Edit in the Gantt toolbar to enter Edit mode
  2. Make one or more changes — for example, drag a task bar to a new date
  3. Click the Undo button in the toolbar to reverse the last change
  4. Click the Redo button to reapply a previously undone change
  5. Continue undoing or redoing as needed, up to the undo_steps limit
The Undo and Redo buttons appear in the toolbar only when the Gantt is in Edit mode. If you do not see them, click the Edit button first.

Change the Undo History Depth

By default, the Gantt stores up to 10 undo steps. To increase or decrease this limit, modify the Gantt Config Script:
  1. Open the Polarion page containing the Gantt widget
  2. Edit the widget properties
  3. Navigate to Advanced > Gantt Config Script
  4. Set the undo_steps property:
gantt.config.undo_steps = 25;
This allows up to 25 undo operations in a single edit session.
Higher undo step values consume more browser memory. For large Gantt charts with many tasks, test the impact of increasing this value on client-side performance.

Interaction with Editing Modes

The availability of undo and redo depends on your editing configuration:
ConfigurationUndo/Redo AvailableNotes
Default (Edit/Close buttons)Yes, in Edit mode onlyButtons appear after clicking Edit
alwaysedit = trueYes, always visibleGantt is always in edit mode
readonly = trueNoAll editing is disabled
hideToolbar = trueNot in toolbarToolbar is hidden; hideToolbar forces alwaysedit = true
Use undo as a lightweight what-if tool. Drag tasks to explore schedule alternatives, then undo all changes to return to the original state without saving. For a more structured approach, see Perform What-If Analysis Without Saving.

Verify Your Configuration

  1. Enter Edit mode in the Gantt
  2. Drag a task bar to a new date position
  3. Click Undo in the toolbar
  4. You should now see the task bar return to its original position
  5. Click Redo to move it back to the new position

See Also

Source Code
  • prod-gantt-src/com.nextedy.polarion.gantt.client/src/js/default.json
  • prod-gantt-src/com.nextedy.polarion.gantt.client/src/js/components/toolbar.js
  • prod-gantt-src/com.nextedy.polarion.gantt.client/src/js/gantt.js
  • prod-gantt-src/com.nextedy.polarion.gantt.client/src/js/config.js