Reputation: 9
i have encountered a problem on filtering in kendo 2012.3.1315.340 grid filtering, i have textboxes on the header template for filter function, once i filter, my paging is not working properly, i get proper data but my page count and total records don't change on the UI
Here is my code..
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();
});
}
Controller:
var result1 = new DataSourceResult
{
Data = gridData.Items,
Total = gridData.TotalCount
};
return Json(result1, JsonRequestBehavior.AllowGet);
Upvotes: 0
Views: 2616
Reputation: 30671
Try using the setDataSource method of the grid. Assigning the dataSource field has no effect.
Upvotes: 1