Triggered before the change of the page.
Parameters
Name | Type | Description |
---|---|---|
e | {object} | event data |
newPage | {number} | The new page |
Examples
sample
<table id="grid"></table>
<script>
var grid = $('#grid').grid({
dataSource: '/Players/Get',
uiLibrary: 'bootstrap4',
iconsLibrary: 'fontawesome',
columns: [ { field: 'ID', width: 56 }, { field: 'Name', sortable: true }, { field: 'PlaceOfBirth' } ],
pager: { limit: 2, sizes: [2, 5, 10, 20] }
});
grid.on('pageChanging', function (e, newPage) {
if (isNaN(newPage)) {
alert('Invalid page number');
return false;
} else {
alert(newPage + ' is valid page number.');
}
});
</script>