Skip to main content


fires before adding an item

beforeAdd: (newItem: any) => boolean | void;


  • newItem: object - the object of an added item


Return false to prevent adding an item into a data collection; otherwise, true.

Example"beforeAdd", function(id){
if (some_check)
return false;
return true;

Related sample: Diagram. Org chart mode. Events

Returning false from the event handler will prevent item adding.