i need to pre-process old data before i can perform sort operation. currently i tried using sort:function(column,direction){….}
using customsort example provided in API.. but its not working as expected.
i just need in-built sorting.. what is the best way to do it..
below is the code i am using..
var data = $resultsGrid.jqxGrid('getrows');;
var sortdata = new Array();
if (direction == 'ascending') direction = true;
if (direction == 'descending') direction = false;
if (direction != null) {
for (i = 0; i < data.length; i++) {
sortdata.push(data[i]);
}
}
else sortdata = data;
Object.prototype.toString = (typeof column == "function") ? column : function () { return this[column] };
if (direction != null) {
sortdata.sort();
if (!direction) {
sortdata.reverse();
}
}
source.localdata = sortdata;
$resultsGrid.jqxGrid('updatebounddata');