Reputation: 141
Hi I have one requirement in Kendo UI Grid pagination.
How to show
I have tried bellow code but not worked, it will show 2 items per page because of latest query selection.
$("div[kendo-grid]").data().kendoGrid.dataSource.query({ pageSize: 3, page: 1 }); $("div[kendo-grid]").data().kendoGrid.dataSource.query({ pageSize: 4, page: 2 }); $("div[kendo-grid]").data().kendoGrid.dataSource.query({ pageSize: 2, page: 3 });
Upvotes: 0
Views: 1396
Reputation: 1466
You should use dataBound event to catch page changes.
var page = $("#grid").data("kendoGrid").dataSource.page();
will give you the current page.
To change page size you can use something like:
if (page == 2){
var grid = $("#grid").data("kendoGrid");
grid.dataSource.pageSize(5);
grid.refresh();
}
Upvotes: 1