Skip to main content

beforeRemove

fires before removing an item from a tree collection

beforeRemove: (removedItem: object) => boolean | void;

Parameters:

  • removedItem: object - the object of an item to remove

Returns:

Return false to prevent removing of an item from a data collection; otherwise true.

Example

component.data.events.on("beforeRemove", function(removedItem){
console.log("An item will be removed");
return true;
});