Toolbar component renders an action bar above the Gantt chart. It is connected to the Gantt via the shared api object and dispatches actions (add, edit, delete, move, copy, etc.) directly to the chart.
Import
Basic usage
Place
Toolbar before the Gantt component in the markup. Pass the same api reference to both so the toolbar can dispatch actions to the chart.Props
The Gantt API object. Obtain it by binding
this on the Gantt component or via the init callback. The toolbar uses this reference to dispatch task actions.Array of button configurations that override the default toolbar items. When omitted, the default set of buttons is used.
Default toolbar buttons
When noitems prop is provided, the toolbar renders the following buttons:
| ID | Type | Label |
|---|---|---|
add-task | button | New task |
edit-task | icon | Edit (Ctrl+E) |
delete-task | icon | Delete (Ctrl+D) |
| (separator) | — | — |
move-task:up | icon | Move up |
move-task:down | icon | Move down |
| (separator) | — | — |
copy-task | icon | Copy |
cut-task | icon | Cut |
paste-task | icon | Paste |
| (separator) | — | — |
indent-task:add | icon | Indent |
indent-task:remove | icon | Outdent |
Customising toolbar items
You can pass a customitems array to add, remove, or reorder buttons. Each object in the array must have at least a comp field.