afterItemResize
Description
Fires after an item's size has been changed
Usage
"afterItemResize": ({
id: string | number,
width: number,
height: number,
x: number,
y: number,
dir: "n" | "ne" | "e" | "se" | "s" | "sw" | "w" | "ne"
}) => void;
Parameters
The callback of the event is called with an object with the following parameters:
id- the id of the resized itemwidth- the new width of the itemheight- the new height of the itemx- the new X-coordinate of the itemy- the new Y-coordinate of the itemdir- the direction of the resize operation:- "n" - north
- "ne" - north-east
- "e" - east
- "se" - south-east
- "s" - south
- "sw" - south-west
- "w" - west
- "nw" - north-west
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("afterItemResize", ({ id, width, height }) => {
console.log(`
The item ${id} has been resized:
width: ${width}
height: ${height}
`);
});
Change log:
- The event is added in v6.1
Related API:
Related samples: