Hi,
I have implemented by using the second suggested method like below, but somehow it make the call to the server twice. E.g. First I loaded the grid with data and sorted a field called ‘A’, then the next time when I fetch the data again from the server, it first make a call with sortdatafield set to A first then immediate make another call to the server with sortdatafield set to ‘DefaultSortFieldName’. How can I stop the first call?
formatData: function (data) {
if (init == true) {
$.extend(data, {sortdatafield: "DefaultSortFieldName" });
init = false;
}
return data;
}
If is not possible then I think it would be easier to implement the first suggestion by checking the ‘sortorder’ parameter in the server side. if is null, then force a default sort in the server.
Many thanks