Skip to main content

beforeRemove

fires before removing an item from a data collection

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

Parameters:

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

Returns:

Return false to block removing 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;
});