剑道网格服务器端过滤和不工作
Posted
技术标签:
【中文标题】剑道网格服务器端过滤和不工作【英文标题】:kendo grid server side filtering and not working 【发布时间】:2018-03-27 15:24:26 【问题描述】:我正在使用具有服务器端过滤、排序和分页功能的 Kendo Grid。
这是我初始化网格的代码:
在此代码中,服务器端分页和虚拟滚动工作正常,但过滤和短路不起作用。
在任何请求中,我都会得到这个
请求参数的类型。
[HttpPost]
public JsonResult getGridData([DataSourceRequest] DataSourceRequest request)
var userList = data;
return Json(userList.ToDataSourceResult(request));
$("#grid").kendoGrid(
dataSource:
type: "aspnetmvc-ajax",
transport:
read:
url: "@Url.Action("getGridData", "ListMaster")",
type: "POST",
dataType: "json",
async: true,
contentType: 'application/json',
data: function (e)
return e;
,parameterMap: function (data, type)
return kendo.stringify(data);
,
schema:
data: function (result)
return result.Data;
,
total: function (result)
return result.Total;
,
pageSize: 20,
serverPaging: true,
serverFiltering: true,
serverSorting: false
,
height: 550,
groupable: true,
sortable: true,
pageable: true,
resizable: true,
scrollable: virtual: true ,
filterable: mode: 'row' ,
pageable:
refresh: true,
pageSizes: true,
buttonCount: 5
,
dataBound: function ()
var data = this.dataSource.view();
,
columns: [ field: "Id", title: "Id", filterable: filter(true), hidden: true ,
field: "Name", title: "Name", filterable: filter(true) ]
);
【问题讨论】:
查看spshell.blogspot.in/2015/12/… 【参考方案1】: $("#grid").kendoGrid(
dataSource:
type: "json",
transport:
read:
url: "@Url.Action("getGridData", "ListMaster")",
type: "POST",
dataType: "json",
async: true,
cache: false,
contentType: 'application/json',
data: function (e)
return e;
,
parameterMap: function (data, type)
return kendo.stringify(data);
,
schema:
data: function (result)
return result.Data;
,
total: function (result)
return result.Total;
,
pageSize: 20,
serverPaging: true,
serverFiltering: true,
serverSorting: false
,
height: 550,
groupable: true,
sortable: true,
pageable: true,
resizable: true,
scrollable: virtual: true ,
filterable:
mode: 'row',
operators:
string:
contains: "contains"
,
pageable:
refresh: true,
pageSizes: true,
buttonCount: 5
,
dataBound: function ()
var data = this.dataSource.view();
,
columns: [ field: "Id", title: "Id", filterable: filter(true), hidden: true ,
field: "Name", title: "Name", filterable: filter(true) ]
);
【讨论】:
以上是关于剑道网格服务器端过滤和不工作的主要内容,如果未能解决你的问题,请参考以下文章
具有服务器端分页/排序的 DevExtreme 数据网格不适用于过滤