The grid and data show up fine, but the sortby doesnt come back after you click once. posting the code below. I added an alert there that shows the sortby and it is undefined after the first try..
var dataModel = {
location: "remote",
sorting: "remote",
paging: "remote",
dataType: "JSON",
method: "GET",
curPage: 1,
rPP: 20,
sortIndx: 0,
sortDir: "up",
rPPOptions: [1, 10, 20, 30, 40, 50, 100, 500, 1000],
getUrl: function () {
var sortDir = (this.sortDir == "up") ? "asc" : "desc";
var sort = ['OrderID', 'CustomerName', 'UnitPrice', 'OrderDate'];
alert(sort[this.sortIndx]);
return {
url: "Paging", data: "pq_curPage=" + this.curPage + "&pq_rPP=" +
this.rPP + "&sortBy=" + sort[this.sortIndx] + "&dir=" + sortDir
};
},
getData: function (dataJSON) {
//var data=
return { curPage: dataJSON.curPage, totalRecords: dataJSON.totalRecords, data: dataJSON.data };
}
}