getEditorButtons
Description
Returns the default configuration of Editor top bar buttonsUsage
getEditorButtons(options?: {
autoSave?: boolean,
resources?: boolean,
splitTasks?: boolean,
}): IEditorButtonConfig[];
Parameters
options(optional) — an object with the next parameters:autoSave— iffalse, adds the Save button to the first button group; omit or set totruewhen the editor saves automatically | PRO featureresources— adds the Resources tab that allows assigning and unassigning resources for the task | PRO featuresplitTasks— adds the Segments tab that allows managing task segments | PRO feature
Returns
Returns an array of objects with the configuration for the Editor topBar buttons:
[
{
items: [
{ /* close icon*/ },
{ /* spacer */},
{ /* Delete button*/},
{ /* Save button*/}, // if autoSave is false
],
},
{/*tabs*/},
]
Example
<script>
import { Gantt, Editor, getEditorButtons } from "@svar-ui/svelte-gantt";
let api = $state();
const topBar = getEditorButtons({
autoSave: false,
resources: true,
splitTasks: true,
});
</script>
<Gantt bind:this={api} {tasks} {links} {scales} />
<Editor {api} {topBar} />
Related articles: