我在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);