Skip to main content

afterAdd

fires after adding an item

afterAdd: (newItem: any) => void;

Parameters:

newItem: object - the object of an added item

Example

diagram.events.on("afterAdd", function(id){
console.log("A new item is added");
});

Event can be used to provide default values or a default formatting for the item data.

Related sample: Diagram. Org chart mode. Events