Skip to main content

close-inline-editor

Description

Fires when closing the inline editor of a task/project

Usage

"close-inline-editor": ({
id: string | number,
save: boolean
}) => void;

Parameters

The callback of the close-inline-editor event can take an object with the following parameters:

  • id - (required) the id of a task/project
  • save - (required) true if the made changes have been saved after closing the editor; otherwise, false
info

To handle the inner events, you can use the Event Bus methods

Example

const { ToDo, Toolbar } = todo;
const {tasks, projects, users} = getData();

const list = new ToDo("#root", {
tasks,
projects,
users
});

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

// subscribe to the "close-inline-editor" event
list.api.on("close-inline-editor", ({id, save}) => {
console.log("The inline editor is closed for the", id, "item");
});

Related article: Inline editing