0

jqGrid's addRowData(idColumnName, array, direction, position) takes an array of rows and inserts them into the current page of the grid, ignoring any pagination settings. So if an array contains 3,000 rows, all 3,000 rows are inserted into the current page.

That throws an "unresponsive script" error in most browsers.

What "tricks" can one use to insert a very large number of rows (i.e. 3,000) into jqGrid at a specific position and have it respect pagination settings?

Donald T
  • 10,234
  • 17
  • 63
  • 91

1 Answers1

3

The usage of addRowData to update (or to add) large number of pages is the wrong way. jqGrid use internal data and _index options to hold the local data (see here, here and here for example). So you can get the reference to internal data parameter with respect of getGridParam. Then you can update the array in any way. You should additionally place the indexes of new added rows in _index or alternatively to call refreshIndex (see here for a code example) which rebuild the _index. In the last case you have to have full data source (data) which contains id property too. After all you should reload the grid (see here about the parameters of reloadGrid) to display updated grid.

Community
  • 1
  • 1
Oleg
  • 220,925
  • 34
  • 403
  • 798
  • Many thanks! I now update the "data" parameter and reloaded the grid. In that way, jqGrid respects pagination settings. – Donald T Sep 27 '12 at 18:26