Search.../

onCurrentIndexChanged( )

Adds an event handler that runs when the current index changes.

Description

The onCurrentIndexChanged() function allows you to optionally perform actions right after the current index changes.

Calling onCurrentIndexChanged() on a write-only dataset causes an error.

Syntax

function onCurrentIndexChanged(handler: CurrentIndexChangedHandler): void
handler: function CurrentIndexChangedHandler(index: number): void

onCurrentIndexChanged Parameters

NAME
TYPE
DESCRIPTION
handler

The current index change event handler.

Returns

This function does not return anything.

Return Type:

void

CurrentIndexChangedHandler Parameters

NAME
TYPE
DESCRIPTION
index
number

The new index.

Returns

This function does not return anything.

Return Type:

void

Was this helpful?

Register a callback to run when the current index changes

Copy Code
1$w("#myDataset").onCurrentIndexChanged( (index) => {
2 let newIndex = index; // 3
3} );