beforeShapeIconClick
Description
Fires before clicking a control in the per-item toolbar
Usage
beforeShapeIconClick: (
iconId: string,
shape: object
) => boolean | void;
Parameters
The callback of the event takes the following parameters:
iconId
- (required) the type or id of the toolbar controlshape
- (required) an object with the item configuration
Returns
Return false
to prevent the toolbar control from being clicked; otherwise, true
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("beforeShapeIconClick", function(iconId, shape) {
console.log("You will click the", iconId, "toolbar control", shape);
return true;
});
Change log: Added in v3.1