My app populates a jqGrid, over and over again, with the results of many different queries the user may make; the queries take the form: give me title, documentCategory, hits, documentType for all documents where the document contains the word 'x'. The user may make many such (ajax) queries, one after the other: Issue query. Read the list of titles returned by the database. Do some work. Make another such query. And so on and so on.
I create the grid once, and when the ajax database call returns with some data, the grid is first depopulated and then repopulated, like this:
$("#titles-table").jqGrid('clearGridData');
.
.
. // loop through the data returned by the ajax database call
for (var i = 0 ...
{
row = ...
$("#titles-table").jqGrid('addRowData',i, row);
}
But now with version 3.7, the grid has a new 'data' property that is supposedly faster than addRowData. The examples demonstrating this new data property show the grid being populated as it is being instantiated (as the colModel is defined, etc etc). But assuming the grid already exists and will be depopulated with a clearGridData call, is there then a way to set the grid's data property to repopulate the grid? Something analogous to clearGridData, like this:
$(#titles-table).jqGrid('setGridData', data);
I am interested in a faster way to populate the grid. Firefox displays the "script taking too long" message when my grid has 75 rows, but Chrome and Opera and Safari blaze right thru this amount of data instantly.