我在 kendo 2012.3.1315.340 网格过滤中遇到了过滤问题,我在标题模板上有用于过滤功能的文本框,一旦我过滤,我的分页无法正常工作,我得到正确的数据,但我的页数和总记录没有'在 UI 上进行更改
这是我的代码..
function searchOnFilters(element) {
var filtersModel = getSearchFilters();
//debugger;
var filterResults = new kendo.data.DataSource({
serverPaging: true,
serverSorting: true,
serverFiltering: true,
batch: true,
pageSize: 50,
transport: {
read: {
url: '@Url.Action("MasterQA_Read", "MasterQA")',
data: { searchFilters: JSON.stringify(filtersModel) },
type: "POST"
}
},
parameterMap: function (data, operation) {
return kendo.stringify(data);
},
schema: {
data: "Data",
total : "Total"
}
});
filterResults.fetch(function () {
// debugger;
var grid = $("#MQASearchGrid").data("kendoGrid");
grid.dataSource = filterResults;
grid.refresh();
});
}
控制器:
var result1 = new DataSourceResult
{
Data = gridData.Items,
Total = gridData.TotalCount
};
return Json(result1, JsonRequestBehavior.AllowGet);