Skip to main content

afterUnSelect

Description

Fires after unselecting an item

Usage

"afterUnSelect": ({
id: string | number,
batch: (string | number)[]
}) => void;

Parameters

The callback of the event is called with an object with the following parameters:

  • id - the id of the unselected item
  • batch - the list of unselected items

Example

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

// attaching a handler to the event
diagram.events.on("afterUnSelect", ({ id }) => {
console.log(id + " was unselected");
});

Here's an example of attaching an event handler to the event for the Diagram Editor:

// initializing Diagram editor
const editor = new dhx.DiagramEditor("editor_container", {
// config options
});
// loading data into the editor
editor.parse(data);

// attaching a handler to the event
editor.diagram.events.on("afterUnSelect", ({ id }) => {
console.log(id + " was unselected");
});

Change log: Updated in v6.0

Related articles: