serverPaging: true,
serverSorting: true,
sort: { field: "Name", dir: "asc" },
serverFiltering: true,
pageSize: 10
When I click the Name column header, the grid sorts in desc order as expected.
When I click for a second time, the options.sort array is not populated.
When I click for a third time, the grid sort in asc order.
It seems that for every second click the options.sort array is not being poulated.
Can this be resolved.
This is the code that I am using:
var investorDataSource = new kendo.data.DataSource({
type: "json",
transport: {
read: {
url: "http://localhost//XXXX?Name=^" + $("#searchfor").val(),
dataType: "json"
},
parameterMap: function (options) {
return {
pageindex: options.page,
pagesize: options.take,
//orderby:options.sort[0].field
orderby: convertSort(options.sort)
}
}
},
schema: {
data: function (result) {
return result.Items || result;
},
total: function (result) {
//Note: this is != to the total no of records, but should work
return (result.PageSize * result.PageCount) || result.length || 0;
}
},
serverPaging: true,
serverSorting: true,
sort: { field: "Name", dir: "asc" },
serverFiltering: true,
pageSize: 10
});