Duplicate Row ID Copy Link
Two rows were given the same ID by your getRowId callback. The grid keys rows by ID, so the second row overwrites the first in its lookup map. Selection, editing, transactions and row state then act on the wrong row, or appear to act on nothing.
This is only ever raised when getRowId is configured. Without it the grid numbers rows itself and they cannot collide.
Find the duplicate Copy Link
The ID in the message is the one that collided. To find which rows produced it, run your callback over the data you passed in:
const seen = new Map();
rowData.forEach((data) => {
const id = getRowId({ data });
seen.set(id, (seen.get(id) ?? 0) + 1);
});
console.log([...seen].filter(([, count]) => count > 1)); Common causes Copy Link
- A business key that is not as unique as expected, such as a name, an email or a SKU reused across records.
- An ID derived from the row's index, which changes as rows are added, removed or sorted.
- A key that is only unique within its parent, so the same value recurs under different groups. Build a composite ID from
parentKeysandlevelin that case. - A default or placeholder value, such as
0or an empty string, standing in for a missing key.
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.
Two further restrictions apply to the value returned. It must not start with the prefix the grid reserves for row grouping (error #14), and it must not be the reserved root node ID (error #331).