Skip to main content

uncheckTask()

Description

Marks a task as incomplete

Usage

uncheckTask({
id: string | number,
manual?: boolean // false by default
}): void;

Parameters

  • id - (required) the id of a task
  • manual - (optional) if true, marks the task in the "manual" mode. If false, the result of applying the method depends on the value which is specified for the behavior attribute of the selectable parameter of the taskShape property

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,
});

// mark the task as completed
list.checkTask({
id: "1.1.1",
});

// mark the specified task as uncompleted
list.uncheckTask({
id: "1.1.1",
manual: true // 'true' - ignores the value of the "behavior" attribute of the "selectable" parameter of the "taskShape" property
});