Search.../

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): Repeater
handler: function ItemRemovedEventHandler(itemData: Object): void

onItemRemoved Parameters

NAME
TYPE
DESCRIPTION
handler

The name of the function or the function expression to run when the item is removed.

Returns

The element on which the event is now registered.

Return Type:

ItemRemovedEventHandler Parameters

NAME
TYPE
DESCRIPTION
itemData
Object

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:

void

Was this helpful?

Get data from items being removed

Copy Code
1$w("#myRepeater").onItemRemoved( (itemData) => {
2 let itemDataValue = itemData.someProperty;
3});