Skip to main content

beforeEditorClose

Description

Fires before the inline editor of an item is closed

Usage

beforeEditorClose: (
id: string | number,
key: string,
subId?: string
) => boolean | void;

Parameters

The callback of the event takes the following parameters:

  • id - (required) the id of the item
  • key - (required) the name of the property to be edited
  • subId - (optional) the id of a subheader of a swimlane or a text element of a line

Returns

Return false to block closing of the inline editor, otherwise true.

Example

// initializing Diagram
const diagram = new dhx.Diagram("diagram_container", {
type: "default"
});
// loading data
diagram.data.parse(data);

// attaching a handler to the event
diagram.events.on("beforeEditorClose", (id, key, subId) => {
console.log(id, key, subId);
return true;
});

Change log:

  • The subHeaderId parameter has been changed to subId in v4.1
  • Added in v4.0