Skip to main content

open-task

Description

Fires when expanding a branch of tasks

Usage

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

Parameters

The callback of the action takes an object with the following parameters:

  • id - (required) the ID of a task
  • mode - (required) defines whether a branch of tasks is opened (true) or closed (false); it's closed by default
info

For handling the actions you can use the Event Bus methods

Example

<script>
import { getData } from "../data";
import { Gantt } from "wx-svelte-gantt";

const data = getData();

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

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

Related articles: How to access Gantt API