Skip to main content

expandTask()

Description

Expands a collapsed task by its id

Usage

expandTask({
id: string | number
}): void;

Parameters

  • id - (required) the id of the task to expand

Example

const { ToDo, Toolbar } = todo;

const list = new ToDo("#root", {
tasks: [
{ id: "1", text: "Task 1 #tag1" },
{ id: "1.1", text: "Task 1.1", parent: "1" },
{ id: "1.1.1", text: "Task 1.1.1", parent: "1.1" },
{ id: "1.2", text: "Task 1.2", parent: "1" },
]
});

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

// collapse the task
list.collapseTask({
id: "1.1",
});

// expand the collapsed task
list.expandTask({
id: "1.1",
});

Related article: Operations with tasks