I am trying to do my own custom paging on the server but on initial load by calling grid.datasource.read() the options.data.skip and take parameters are null
$scope.searchGridOptions = {
dataSource:
new
kendo.data.DataSource({
type:
"ajax"
,
transport: {
read:
function
(options) {
$scope.FilterMeta.QueryFilterSearchViewModel.StartIndex = options.data.skip ? options.data.skip : 0;
$scope.FilterMeta.QueryFilterSearchViewModel.DisplayLength = options.data.take ? options.data.take : 10;
var
js = JSON.stringify(createSearchRequestData($scope.FilterMeta));
//e.data.push({ queryFilterSearchViewItem: js })
$.ajax({ method:
'POST'
, url:
'http://localhost:6661/api/Schools/GetEntitiesForSearch'
, data: { queryFilterSearchViewItem: js } })
.success(
function
(data) {
return
options.success(data);
}).error(
function
(error) {
options.error(error);
});
}
},
schema: {
data:
function
(data) {
return
data.Results;
},
// records are returned in the "data" field of the response
total:
function
(data) {
return
data.TotalEntityCount;
}
},
serverFiltering:
true
,
serverSorting:
true
,
pagesize: 10,
serverPaging:
true
}),
error:
function
(e) {
if
(e.errors) {
alert(e.errors);
}
},
sortable:
true
,
pageable:
true
,
scrollable:
false
,
autoBind:
false
,
columns: $scope.searchGridColumns
};