onItemRemoved( )
Sets the function that runs when a repeated item is removed.
Description
Use the onItemRemoved()
function for code you want to run when
repeated items are removed. The callback is triggered when you remove
items by setting the value of the data
property to an array
in which some of the existing item IDs are no longer present or when items
are removed based on a dataset that is connected to the repeater.
Note: The
onItemRemoved()
callback function is not called when the static repeated items that were set in the Editor are removed.
Syntax
function onItemRemoved(handler: ItemRemovedEventHandler): Repeaterhandler: function ItemRemovedEventHandler(itemData: Object): void
onItemRemoved Parameters
NAME
TYPE
DESCRIPTION
The name of the function or the function expression to run when the item is removed.
ItemRemovedEventHandler Parameters
NAME
TYPE
DESCRIPTION
The object from the repeater's data
array that corresponds to the repeated item being removed.
Returns
This function does not return anything.
Return Type:
Was this helpful?
Get data from items being removed
1$w("#myRepeater").onItemRemoved( (itemData) => {2 let itemDataValue = itemData.someProperty;3});