I\'m trying to use jqGrid with local data and I\'m finding a couple of issues:
I\'m initializing the thing like so:
function refreshGrid($grid, results)
I haven't found a good documented way to update jqGrid's local data, here is how I extended jqGrid to solve my problem:
$.extend($.fn.jqGrid, { setData: function(data) {
this[0].p.data = data;
return true;
} } );
After this you can do the following to update jqGrid with new data:
suppose your grid was declared like this:
jQuery("#list").jqGrid({ datatype: "local", ... other params ... });
then you can do:
jQuery("#list").jqGrid('setData', array_with_new_data);
jQuery("#list").trigger("reloadGrid");
P.S. see the link on how to fetch all data from the grid Retrieving contents of the grid