I\'ve been having problems getting jqGrid to sort. I\'d like to preferable do this sorting on the client, but I\'m also willing to make a new call to the database to get th
Found one solution, though not entirely sure why this works. Perhaps someone can provide a better answer.
var x = $("#grid").jqGrid({
jsonReader: { root: "rows", repeatitems: false },
datatype: "json",
height: 'auto',
autowidth: true,
forceFit: true,
colNames:['ID','Name'],
colModel:[
{name:'id', key:true, index:'id', width:60, sorttype:"int", jsonmap:"id"},
{name:'name', index:'name', width:90, jsonmap: "name"}
],
caption: "Results",
//Required for client side sorting
loadonce: true,
gridComplete: function(){
$("#grid").setGridParam({datatype: 'local'});
}