beforeAdd
fires before adding a new item into a tree collection
beforeAdd: (newItem: object) => 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;
});