Skip to main content

itemClick

Description

Fires on clicking an item

If a click is done over a swimlane, the event will be fired on the cell of the swimlane

Usage

itemClick: (
id: string | number,
event: MouseEvent
) => void;

Parameters

The callback of the event takes the following parameters:

  • id - (required) the id of an item
  • event - (required) a native HTML event object

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("itemClick", (id, event) => {
console.log(id, event);
});

Change log: Added in v4.0

Related article: Event handling