Skip to main content

afterItemCatch

info

The event works only in the org chart and mindmap modes of Diagram, the itemsDraggable property must be set to true

Description

Fires after an item is caught

Usage

afterItemCatch: (
movedId: string | number,
targetId: string | number,
event: MouseEvent
) => void;

Parameters

The callback of the event takes the following parameters:

  • movedId - (required) the id of the moved item
  • targetId - (required) the id of the target item
  • event - (required) a native HTML event object

Example

// initializing Diagram Editor
const editor = new dhx.DiagramEditor("editor_container");
// loading data
editor.parse(data);

// attaching a handler to the event
editor.events.on("afterItemCatch", (movedId, targetId, event) => {
console.log("afterItemCatch", movedId, targetId, event);
});

Change log: Added in v4.1