Skip to main content

beforeAdd

fires before adding a new item into a tree collection

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

Parameters:

newItem: object - the object of an added item

Returns:

Return false to prevent adding of an item; otherwise, true.

Example

component.data.events.on("BeforeAdd", function(newItem){    console.log("A new item will be added");    return true;});