api.exec(action, data) to trigger mutations in the Gantt store. After an action is processed, the corresponding event fires for any listeners registered with api.on(). Actions can be blocked by returning false from an api.intercept() handler.
add-task
Adds a new task to the Gantt.Properties for the new task. At minimum,
text is recommended.The ID of an existing task used as the insertion reference point. If omitted, the task is appended at the root level.
How to position the new task relative to
target. Defaults to 'child' when called from the grid’s add button.When
true, the editor opens automatically after the task is inserted.update-task
Updates properties on an existing task.The ID of the task to update.
An object containing only the fields to update. Merged with the existing task.
A number of time units to shift
start/end dates. Used internally by drag-and-drop; you can also set it directly for programmatic shifting.Pass
true during live drag previews to signal that the update is not yet final (suppresses some side-effects). Pass false to mark the final update.delete-task
Deletes a task and all of its descendants.The ID of the task to delete.
move-task
Moves a task to a new position in the task tree (reordering), or programmatically repositions it relative to another task.The ID of the task to move.
The direction or relationship for the move.
The ID of the reference task. Required when
mode is 'before', 'after', or 'child'.Set to
true during live drag preview updates. Set to false (or omit) for the final commit.select-task
Changes the current task selection.The ID of the task to select.
When
true, adds or removes the task from a multi-selection (Ctrl/Cmd behaviour).When
true, extends the selection from the current anchor to this task (Shift behaviour).When
true, scrolls the chart so the selected task bar is visible.sort-tasks
Sorts the task list by the specified column.The column key to sort by (e.g.
"text", "start", "duration").The sort direction.
When
true, appends this sort criterion to a multi-column sort instead of replacing the current sort.show-editor
Opens or closes the task editor panel.The ID of the task to edit. Pass
null to close the editor.open-task
Expands or collapses a summary task node in the grid.The ID of the summary task to toggle.
true to expand the node, false to collapse it.drag-task
Dispatched internally during task bar drag operations on the chart. Can be intercepted to restrict dragging.The ID of the task being dragged.
Current pixel left offset of the task bar.
Current pixel width of the task bar.
Present when the task is being reordered vertically. Undefined during horizontal move/resize.
true while dragging; false on drop.add-link
Adds a new dependency link between two tasks.update-link
Updates properties on an existing dependency link.The ID of the link to update.
The fields to update on the link.
delete-link
Deletes a dependency link.The ID of the link to delete.
zoom-scale
Changes the zoom level of the chart. Dispatched internally on Ctrl+scroll, but can also be called programmatically.Zoom direction: positive values zoom in, negative values zoom out.
Horizontal pixel offset for the zoom anchor point (keeps the view centered on that position).
provide-data
Delivers lazily loaded child data in response to arequest-data event.
The ID of the parent task that triggered the
request-data event.export-data
Exports the Gantt chart to a file. Requires a connection to the SVAR export service.The URL of the export service endpoint.
The output format.
PDF-specific options (size, landscape, fitSize, styles).
PNG-specific options (size, landscape, fitSize, styles).
Excel-specific options (columns, sheetNames, dateFormat, visual chart).
Gantt configuration overrides applied only during export (e.g.
{ cellWidth: 30 }).import-data
Imports task data from an external format (e.g. MS Project XML).The raw data string to import (e.g. XML content read from a file).
undo
Reverts the last change. Requires theundo prop on the <Gantt> component.
redo
Re-applies the last reverted change. Requires theundo prop on the <Gantt> component.