【问题标题】:Pagination is not working on Kendo Grid分页不适用于剑道网格
【发布时间】:2014-09-12 21:20:36
【问题描述】:

我正在尝试了解 Kendo UI 网格的工作原理。这个the example for the Kendo website

在某处可以找到此配置行:

pageSize: 20,
serverPaging: true,
serverFiltering: true,
serverSorting: true

这是获取数据的行

transport: {
             read: "http://demos.telerik.com/kendo-  ui/service/Northwind.svc/Orders"
        },

不知道上面的参数是不是被发送到服务器,即服务器端的方法应该是这样的?

public list<type> MyServerSideMethod(inr pageSize, bool serverPaging,
                  bool serverFiltering, boll serverSorting)
{

}

事实上,我已经应用了配置,但我网格上的寻呼机仍然无法正常工作。这就是为什么我想知道服务器中的方法是否期望这些值。

感谢您的帮助

【问题讨论】:

    标签: kendo-ui


    【解决方案1】:

    将您的读取定义为一个函数并操作发送到服务器的参数

    transport: {
                read: function (options) {
                    console.log(JSON.stringify(options)); // You can see what parameters send : check your console on paging 
    
                   var commandOBJ=[{
                        Page: 1, // Once the first 20 item is loaded and you click for the next page you will have the page in "options" (should be like options.page)
                        PageSize:20 
                    }];
    
                    $.ajax({
                        url:"http://demos.telerik.com/kendo-  ui/service/Northwind.svc/Orders",
                        data: {  }, // send your page info here 
                        dataType: "json", // your data return type 
                        cache: false,
                        success: function (result) {
                            options.success(result);
                        },
                        error: function (result) {
                            options.error(result);
                        }
                    });
                }
            }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-09-10
      • 1970-01-01
      • 1970-01-01
      • 2023-03-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多