I have a grid setup with sorting enabled. Each row has a duplicate button. When duplicating a row, I would like to insert the new row just below the copied row. This works w
it randomly inserts the row into the grid, making it hard to find.
Actually it's not random, new values could be inserted via updateRowData
api.updateRowData({add:[listofvalues], addIndex:startIndexPosition})
where listofvalues
list of objects to insert (even if it would be just one object), and startIndexPosition
index of position from where insert will start without sorting
Let's go deeper, the ag-grid has few states:
rowData
and on this case addIndex
is matter, and I suppose only on default state addInex
is used.Simple example for demonstration
try to sort (change to sort asc,desc, and default) by athlete and click add row, you will see new rows on start,end and on inserted place (with default state)