Search.../

onChange( )

Adds an event handler that runs when the pagination bar is changed.

Description

A pagination bar receives a change event when a user changes the current page by interacting with the pagination bar.

A change event is not triggered when you change a pagination bar's current page using the currentPage property.

When a pagination bar is connected to a dataset, changing the dataset's current page using dataset functions, such as nextPage(), do not trigger change events on the pagination bar.

Syntax

function onChange(handler: EventHandler): Pagination
handler: function EventHandler(event: Event): void

onChange Parameters

NAME
TYPE
DESCRIPTION
handler

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

Returns

The pagination bar on which the event is now registered.

Return Type:

EventHandler Parameters

NAME
TYPE
DESCRIPTION
event

The event that occurred.

Returns

This function does not return anything.

Return Type:

void

Was this helpful?

Get the new current page of the pagination bar that was changed

Copy Code
1$w("#myPagination").onChange( (event) => {
2 let newValue = event.target.currentPage; // 4
3});