Skip to main content

expand-task

Description

Fires when expanding a task

Usage

"expand-task": ({
id: string | number
}) => void;

Parameters

The callback of the expand-task event can take an object with the following parameters:

  • id - (required) the id of a task
info

To handle the inner events, you can use the Event Bus methods

Example

const { ToDo, Toolbar } = todo;
const {tasks, projects, users} = getData();

const list = new ToDo("#root", {
tasks,
projects,
users
});

const toolbar = new Toolbar("#toolbar", {
api: list.api,
});

// subscribe to the "expand-task" event
list.api.on("expand-task", ({id}) => {
console.log("The", id, "task is expanded");
});

Related article: Operations with tasks