Skip to main content

shapeDblClick

Description

Fires on double-clicking a shape

Usage

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

Parameters

The callback of the event takes the following parameters:

  • id - (required) the shape id
  • 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("shapeDblClick", function(id) {
console.log('An item "' + diagram.data.getItem(id).text + '"double-clicked');
});

Related article: Event handling

Related samples: