使用客户端Kendo UI Grid实现服务器端分页? [英] Implement server-side paging with client-side Kendo UI Grid?

查看:84
本文介绍了使用客户端Kendo UI Grid实现服务器端分页?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能告诉我如何使用客户端Kendo UI Grid来实现服务器端分页? 我使用下面的方法.

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: [{....]
           });
             }

});

推荐答案

您可以在telerik的演示页面上查看示例: http://demos.telerik.com/kendo-ui/grid/remote -数据绑定

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

最重要的内容在下面的配置中列出(serverPaging,可分页).该服务还必须实现服务器分页.例如,您可以看一下telerik演示服务: https://github.com /telerik/kendo-ui-demos-service

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: []
  });
});

这篇关于使用客户端Kendo UI Grid实现服务器端分页?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆