Implement server-side paging with client-side Kendo UI Grid?

混江龙づ霸主 提交于 2020-01-07 02:48:10

问题


Can anyone tell me how can I implement server-side paging with client-side Kendo UI Grid? I use below method.

if any one use this method please help.

$(document).ready(function () {
 function loadGrid(){
$.ajax({
   .....
   data: JSON.stringify({
   //skip: skip,
   //take: take,
 }),
 success: function (result) {
var datsource = new kendo.data.DataSource({
   data: result.d,
   schema: {
       model: {
           id: "TemplateID",
           fields: {.... }
               }
            },          
       serverPaging: true,
       pageSize: 10,
   });
  $("#grdOtherBomRequest").kendoGrid({
      dataSource: datsource,                            

      serverFiltering: true,
      serverSorting: true,
      serverPaging: true,
      columns: [{....]
           });
             }

});

回答1:


You can take a look at the example on telerik's demo page: http://demos.telerik.com/kendo-ui/grid/remote-data-binding

The most important are listed in the config below (serverPaging, pageable). Also the service has to implement server paging. For an example you can take a look on the telerik demo service: https://github.com/telerik/kendo-ui-demos-service

$(document).ready(function() {
  $("#grid").kendoGrid({
    dataSource: {
      type: "odata",
      transport: {
        read: "//demos.telerik.com/kendo-ui/service/Northwind.svc/Orders"
      },
      schema: {
        model: {
          fields: {}
        }
      },
      pageSize: 20,
      serverPaging: true,
      serverFiltering: true,
      serverSorting: true
    },
    filterable: true,
    sortable: true,
    pageable: true,
    columns: []
  });
});


来源:https://stackoverflow.com/questions/39447585/implement-server-side-paging-with-client-side-kendo-ui-grid

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