1

I have a table with jqGrid. I am able to add a new row at the end / first position of the table using :

jQuery('#tableId').jqGrid('addRow', parameters);

where parameters are:

var parameters = { rowID: 'new_row', position: 'last', useDefValues: true}

However, I have a table with grouping enabled. And I want to insert a row under a certain grouping (always the last row at that group, but can be the middle in the table, depending where the grouping is). The current workaround I have is to modify the data and the options so it will redraw the whole table, but I don't want that due to performance issue. I am interested in inserting a row inside a certain grouping.

Is this possible? I looked at a similar post here, however it adds a new row after or before a selected row. Is it possible to insert a row after a certain row / inside a certain group?

Thank you very much!

Community
  • 1
  • 1
blenzcoffee
  • 851
  • 1
  • 11
  • 35
  • It's unclear how you use jqGrid. Do you use server side paging or not? Which fork of jqGrid and in which version you use? By the way the usage of `rowID: 'new_row'` is not good. Default value `rowID: undefined` is better because it generates *unique* rowid. Reloading of jqGrid means reloading of **the current page** only. So it works typically quickly enough. How many rows and columns you have in the grid and on the page? – Oleg Jul 21 '15 at 12:20

0 Answers0