Row Data Object Not Found Copy Link
A transaction asked the grid to update or remove a row, and the grid could not find it. No getRowId is configured, so rows are matched by object reference. The object you passed is not the same object the grid is holding, even if its contents are identical.
The usual cause is data that has been through a copy since the grid received it:
- An immutable update that replaced the object rather than mutating it, which is the normal pattern in Redux, NgRx, Pinia and similar stores.
- A round trip through
JSON.parse(JSON.stringify(...)), a spread, or a mapping function. - A fresh response from an API, where the objects are new even though the records are the same.
- Data re-fetched or re-derived between handing it to the grid and building the transaction.
Configure getRowId Copy Link
Matching on an ID rather than a reference fixes the whole class of problem, and is faster:
<ag-grid-angular
[getRowId]="getRowId"
/* other grid options ... */ />
this.getRowId = (params) => params.data.employeeId;With an ID configured, remove items need only carry the key, and a failed lookup reports the ID it could not find (error #4) rather than dumping the object.
Or pass the original object Copy Link
If you cannot provide an ID, the transaction must carry the exact object the grid was given. Keep a reference to it, or read it back from the grid through the row node, rather than reconstructing an equivalent object.
How the grid identifies a row Copy Link
When you hand the grid a data item, it has to match that item against a row it already holds. It does this in one of two ways, and which one applies decides how identity problems present:
- With
getRowIdconfigured, rows are matched on the id your callback returns. - Without it, rows are matched by object reference, using
===against the data you previously gave the grid.
See Identifying Rows for Update and Remove for how this affects transactions.
The getRowId contract Copy Link
The callback must return a string that is unique across the rows in the grid, the same on every call for a given row, and stable across data updates. Returning a value that is not a string raises error #25.
Its params include parentKeys and level alongside data, so a composite id can be built where a business key is only unique within its parent.
See Row IDs for the full detail.