Skip to main content

indent-task

Description

Fires when indenting a task

Usage

"indent-task": ({
id: string | number,
mode: boolean
}) => boolean|void;

Parameters

The callback of the indent-task action can take an object with the following parameters:

  • id - (required) the ID of the indented task
  • mode - (boolean) if true, a task becomes a child of the task above
info

For handling the actions you can use the Event Bus methods. Returning false from the action handler will block the action (see Preventing actions)

Example

<script>
import { getData } from "./common/data";
import { Gantt } from "@svar-ui/svelte-gantt";

const data = getData();

function init(api) {
api.exec("indent-task", {
id: 3,
mode: true,
});
}
</script>

<Gantt {init} tasks={data.tasks} />

Related articles: How to access Gantt API