Skip to main content

updateProject()

Description

Updates configuration parameters of a project

Usage

updateProject({
id: string | number,
project: object
}): void;

Parameters

  • id - (required) the ID of the project to be updated
  • project - (required) an object with a hash of project's parameters which need to be updated:
    • label - (optional) the name of the 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,
});

// update some configuration of the project
list.updateProject({
id: "second",
project: {
label: "Project 2"
}
});

Related article: Operations with projects