谁能告诉我如何使用客户端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的演示页面上查看示例: demos.telerik/kendo-ui/grid/remote -数据绑定
You can take a look at the example on telerik's demo page: demos.telerik/kendo-ui/grid/remote-data-binding
最重要的内容在下面的配置中列出(serverPaging,可分页).该服务还必须实现服务器分页.例如,您可以看一下telerik演示服务: github /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: github/telerik/kendo-ui-demos-service
$(document).ready(function() { $("#grid").kendoGrid({ dataSource: { type: "odata", transport: { read: "//demos.telerik/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实现服务器端分页?
发布评论