Skip to main content

deleteProject()

Description

Removes a project

note

The tasks linked to the project won't be removed.They will be moved to the "No project" section

Usage

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

Parameters

  • id - (required) the ID of a project

Example

const { ToDo, Toolbar } = todo;

const list = new ToDo("#root", {
projects: [
{ id: "first", label: "First project" },
{ id: "second", label: "Second project" },
{ id: "third", label: "Third project" },
]
});

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

// remove a project
list.deleteProject({ id: "first" });

Related article: Operations with projects