Skip to main content

afterGroupMove

Description

Fires when a group or swimlane is moved one grid step

Usage

afterGroupMove: (
event: MouseEvent,
id: string | number,
coord: object
) => void;

Parameters

The callback of the event takes the following parameters:

  • event - (required) a native HTML event object
  • id - (required) the id of an item
  • coord - (required) an object with the x and y coordinates of the group or swimlane position after movement

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("afterGroupMove", (event, id, coordinates) => {
console.log(`
Group ${id} position:
x: ${coordinates.x}
y: ${coordinates.y}
`);
});

Change log: Added in v4.0