Dear all, Let's say I have a perfectly fine JSON serialized string, like so:
{"Page":0,"Total":0,"Records":0,"Rows":[{/*blah*/}]}
This isn't returned by a particular URL, it's just sitting there, happy as it can be (harcoded). How do I add it to jqGrid? I've tried every conceivable variation of the loadComplete
function or a addJSONData
variant, latest:
loadComplete: function(){
var mygrid = jQuery("#grid")[0];
var o = eval("(" + {"Page":0,"Total":0,"Records":0,"Rows":[{/*blah*/}]} + ")");
mygrid.addJSONData(o.result);
}
but it won't work. It has worked when I've returned the JSON by a URL, however. Am I missing something when I use:
dataType:"json",
url: "/SomePageThatDoesntDoAnything"
I have a sneaky feeling it might have to do with having to reload the grid. Any help will be greatly appreciated.