Skip to main content

set-edit

Description

Triggered when the editor is toggled

Usage

"set-edit": ({ cardId: string | number, eventSource?: "select-card" } | null) => void;

Parameters

The callback for the set-edit event accepts either null or an object with these properties:

  • cardId - (required) the ID of the card being edited
  • eventSource - (optional) indicates the "select-card" action that triggered the set-edit event
note

A null value means the editor is being closed

info

To manage internal events, the Event Bus methods can be used

Example

// create Kanban
const board = new kanban.Kanban("#root", {
columns,
cards
});
// block editing when a user single-clicks a card
board.api.intercept("set-edit", (ev) => {
return ev?.eventSource != "select-card";
});

Change log:

  • The event was introduced in v1.2
  • The eventSource parameter was added in v1.6

Related samples: Kanban. Open the editor by double-clicking on the task