What kind of datasource are you using and how is it configured? It is working fine for me. I have to massage how requests are made and how to read the results... but it works fine for me. It may be in your specific implementation. Post your code.
Here's a snippet of my datasource in the grid init:
dataSource:
{
schema: {
model: {
id:
"List"
,
fields:
{
ProductIdentity: { type:
"number"
},
Name: { type:
"string"
},
GroupName: { type:
"string"
},
Manufacturer: { type:
"string"
},
PartNo: { type:
"string"
},
UnitsLeft: { type:
"number"
},
NetAmount: { type:
"number"
},
IsActive: { type:
"boolean"
}
}
},
data:
function
(data) {
var
newdata = Sys.Serialization.JavaScriptSerializer.deserialize(data).d;
return
newdata.List;
// <-- Results returned in List array from server
},
total:
function
(data) {
var
newdata = Sys.Serialization.JavaScriptSerializer.deserialize(data).d;
return
newdata.Count;
// my object returns a Count property
}
},
transport: {
read: {
url:
"/AjaxHandler.ashx/WebServiceGridCall"
,
contentType:
"application/json; charset=utf-8"
, type:
"POST"
},
parameterMap:
function
(data, operation) {
if
(operation ==
"read"
) {
var
sortString =
''
;
var
filterString =
''
;
// run sorter
if
(data.sort) {
$.each(data.sort,
function
(index, value) {
sortString += value.field +
" "
+ value.dir +
','
;
});
sortString = sortString.rtrim(
','
);
// custom rtrim() method
}
// filter - build my own custom string that is Dynamic Linq friendly (Google DynamicQueryable.cs)
if
(data.filter) {
$.each(data.filter.filters,
function
(index, value) {
filterString += value.field +
'.ToLower().Contains("'
+ value.value +
'")'
;
if
(index < (data.filter.filters.length - 1))
filterString +=
" AND "
;
});
}
return
JSON.stringify(
// stringify my own custom object to be parsed in Page Handler
{
serviceCallName:
"GetProducts"
,
parameters: {
"startIndex"
: data.skip,
// <-- start Index which will be used on the server side to get the start index of the collection to be returned. You will need to send the start index and pageSize to the server so the server can either query based on that or extract those specific results from whatever Array is returned before returning it to the client.
"maxRows"
: data.pageSize,
// <-- # of rows to return (per page)
"sortExpressions"
: sortString,
"filterExpressions"
: filterString,
"defaultSortExpression"
:
""
}
});
}
}
},
pageSize: 10,
serverPaging:
true
,
serverFiltering:
true
,
serverSorting:
true
}