api.exec(actionName, params), or intercept them with api.intercept(actionName, callback) before they are applied.
Task actions
add-task
Adds a new task to the chart.Task data for the new task.
start defaults to the project start if not provided. duration defaults to 1.ID of the reference task. The new task is positioned relative to this task using
mode.Insertion position relative to
target. "child" adds the new task as a child of target.Scroll the chart to make the new task visible. Pass
true to scroll vertically, or "x", "y", "xy" to control axes.Automatically select the newly added task.
ev.id is populated with the generated task ID; ev.task is the normalized task object.
update-task
Updates an existing task’s properties.ID of the task to update.
Object containing the fields to update. Only the provided fields are changed.
Index of the segment to update on a split task.
Internal pixel offset used during drag operations. Not required for direct API calls.
delete-task
Deletes a task and all its children. Also removes any links that reference the deleted task(s).ID of the task to delete.
copy-task
Creates a copy of a task and its subtree, placing it relative to a target task.ID of the task to copy.
ID of the reference task for placement.
Placement mode relative to
target.ev.id contains the new task’s ID; ev.source contains the original task’s ID.
move-task
Moves a task to a different position in the task tree or reorders it within its branch.ID of the task to move.
Move direction or placement relative to
target."before"/"after"— place adjacent totarget"child"— place as a child oftarget"up"/"down"— move one position in the current branch (notargetneeded)
ID of the reference task. Required unless using
"up" or "down" modes.Internal flag used during drag-and-drop. Not required for direct API calls.
indent-task
Changes the indentation level of a task, effectively making it a child of the previous sibling (mode: true) or promoting it to its parent’s level (mode: false).
ID of the task to indent or outdent.
true to indent (increase nesting level); false to outdent (decrease nesting level).Link actions
add-link
Adds a new dependency link between two tasks.Link object. Must include
source, target, and type. id is auto-generated if omitted.ev.id contains the new link’s ID; ev.link is the normalized link object.
update-link
Updates an existing link’s properties.ID of the link to update.
Object containing the fields to update.
delete-link
Deletes a dependency link.ID of the link to delete.
Selection and navigation
select-task
Selects a task, optionally scrolling to it.ID of the task to select.
When
true, adds the task to the current selection (Ctrl+click behavior).When
true, selects a range from the last selected task to this one (Shift+click behavior).Scroll the chart to make the selected task visible.
Moves keyboard focus to the grid or chart area after selection.
open-task
Expands or collapses a summary task.ID of the summary task.
true to expand; false to collapse.Display actions
sort-tasks
Sorts the task list by a column.The task field name to sort by (e.g.
"text", "start", "duration").Sort direction.
When
true, adds this sort criterion to an existing multi-column sort instead of replacing it.filter-tasks
Filters the visible tasks.Custom filter function. Return
true to show a task, false to hide it.Field name for built-in filter (used with the header filter menu).
Filter value for the built-in column filter.
When
true, matching parent tasks are expanded to show filtered children.scroll-chart
Programmatically scrolls the chart area.Horizontal scroll position in pixels.
Vertical scroll position in pixels.
Scroll to a specific date on the horizontal axis. Takes precedence over
left if both are provided.resize-chart
Notifies the chart of a container size change. This is normally called internally on resize events.New chart width in pixels.
New chart height in pixels.
Scrollbar size in pixels.
Data actions
export-data
Exports the Gantt chart to a file. PRO feature.Export server URL.
Output format.
Name for the downloaded file.
PDF-specific options:
{ fitSize?, size?, landscape?, styles?, margins?, header?, footer?, scale? }.PNG-specific options:
{ fitSize?, size?, landscape?, styles? }.Excel-specific options:
{ sheetNames?, visual?, dateFormat?, columns?, indent? }.undo / redo
Traverses the undo/redo history. Requiresundo: true in the config. PRO feature.
Internal actions
The following actions are used internally by the Gantt. They can be intercepted but are not intended for direct external use.| Action | Description |
|---|---|
drag-task | Fired during a drag operation with pixel coordinates |
zoom-scale | Fired on mouse-wheel zoom |
render-data | Updates the visible area viewport |
request-data | Requests lazy-loaded child data for a task |
provide-data | Injects lazy-loaded data into the store |
show-editor | Opens the task editor panel |
hotkey | Fired on keyboard shortcut |
schedule-tasks | Triggers auto-scheduling recalculation |
split-task | Splits a task into segments |