closeInlineEditor()
Description
Closes the inline editor of a task/project
Usage
closeInlineEditor({
id: string | number,
save?: boolean
}): void;
Parameters
id
- (required) the id of a task/projectsave
- (optional) defines whether the changes should be saved after closing the editor; true by default
Example
const { ToDo, Toolbar } = todo;
const list = new ToDo("#root", {
tasks: [
{ id: "1", text: "Task 1" },
{ 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,
});
// close inline editor of the task without saving the changes made
list.closeInlineEditor({
id: "1.1.1",
save: false
});
Related article: Inline editing