ContextMenu component wraps the Gantt component and intercepts right-click events on tasks. It presents a menu of task actions (add, edit, delete, move, convert, etc.) and dispatches them to the Gantt via the shared api object.
Import
Basic usage
Wrap theGantt component with ContextMenu and pass the same api reference to both:
Props
The Gantt API object. Obtain it by binding
this on the Gantt component. The context menu uses this reference to dispatch task actions when a menu item is selected.Array of menu option definitions that override the default menu. When omitted, the default set of options is used.
The
Gantt component (or any other content) to wrap. The context menu attaches its listener to the content inside this slot.Default menu items
| ID | Label | Notes |
|---|---|---|
add-task | Add | Sub-menu: Child task, Task above, Task below |
| (separator) | — | — |
convert-task | Convert to | Sub-menu: built from taskTypes |
edit-task | Edit | Hidden for segments |
| (separator) | — | — |
cut-task | Cut | Ctrl+X |
copy-task | Copy | Ctrl+C |
paste-task | Paste | Ctrl+V |
move-task | Move | Sub-menu: Up, Down |
| (separator) | — | — |
indent-task:add | Indent | — |
indent-task:remove | Outdent | — |
| (separator) | — | — |
delete-task | Delete | Ctrl+D / Backspace |