How to change Kendo UI grid page index programmatically?

旧街凉风 提交于 2019-12-18 12:45:51

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!