【问题标题】:Implement server-side paging with client-side Kendo UI Grid?使用客户端 Kendo UI Grid 实现服务器端分页?
【发布时间】:2017-01-19 17:31:31
【问题描述】:

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

如果有人使用这种方法,请帮忙。

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

});

【问题讨论】:

标签: asp.net kendo-ui grid


【解决方案1】:

您可以查看 Telerik 演示页面上的示例: http://demos.telerik.com/kendo-ui/grid/remote-data-binding

最重要的在下面的配置中列出(serverPaging,pageable)。该服务还必须实现服务器分页。例如,您可以查看 Telerik 演示服务: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: []
  });
});

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-10-07
    • 1970-01-01
    • 1970-01-01
    • 2014-02-18
    • 1970-01-01
    • 2023-03-10
    • 2017-05-10
    • 1970-01-01
    相关资源
    最近更新 更多