Skip to main content

open-inline-editor

Description

Fires when opening the inline editor of a task/project

Usage

"open-inline-editor": ({
id: string | number,
type: "task" | "project"
}) => void;

Parameters

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

  • id - (required) the id of a task/project
  • type - (required) the type of the item: "task" or "project"
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 "open-inline-editor" event
list.api.on("open-inline-editor", ({id, type}) => {
console.log("The inline editor is opened for the", type, "with ID:", id);
});

Related article: Inline editing