Skip to main content

change

Description

fires when the current page is changed in the pager

Parameters

  • ev - (object) a CustomEvent object. Its detail property contains:
    • page - (object) an object with the number of the newly opened page and the numbers of the start and end rows of this page

Example

<script>
function changeHandler(ev) {
const newState = ev.detail;
console.log(newState);
// => {value: 2, from: 20, to: 40}
}
</script>

<Pager value={2} total={100} on:change={changeHandler} />

Details

The handler function receives an object with the number of the newly opened page and the numbers of the start and end rows of this page.

Related article: Catching the change of the active page