问题
I have a kendo ui grid. Let's say that the JS variable pointing to the grid is called grid
. How can I go to page 3 programmatically? Thanks.
回答1:
You might to use:
grid.dataSource.query({ page: 3, pageSize: 20 });
Documentation in here.
or:
grid.dataSource.page(3);
Documentation in here
回答2:
Answer is just set it pate: 1 when datasource created
var dataSource = new kendo.data.DataSource({
data: [
{ name: "Tea", category: "Beverages" },
{ name: "Coffee", category: "Beverages" },
{ name: "Ham", category: "Food" }
],
page: 1,
// a page of data contains two data items
pageSize: 2
});
来源:https://stackoverflow.com/questions/13976496/how-to-change-kendo-ui-grid-page-index-programmatically