Row Identity & Epochs
Stable row identity allows NextGrid to keep row selection, cell focus, detail expansion, and incremental transactions aligned across sorting, filtering, and row updates.
Identity Strategies (RowIdentityStrategy)
Section titled “Identity Strategies (RowIdentityStrategy)”| Strategy | Example | Best For | Restrictions |
|---|---|---|---|
getRowId |
(row) => row.id |
Custom or derived IDs | Must return a unique non-empty string |
rowKey |
'id' or ['tenant', 'id'] |
Single property or composite key | All key fields must be present |
generateRowId |
'uuid' or 'index' |
Prototyping without natural IDs | 'uuid' is disallowed on rowSource and remote models |
Row selection (rowSelection) and range selection (cellSelection) require an explicit identity strategy (or rowSource.getRowId).
Duplicate IDs & dataEpoch
Section titled “Duplicate IDs & dataEpoch”- Duplicates: Duplicate IDs are detected and surfaced via
diagnostics/ error guards so selection and transactions never target ambiguous rows. dataEpoch: Every full dataset replacement (setRowData,setRowSource) or row transaction advancesdataEpoch. Pending async edits, clipboard pastes, and queued async transactions compare their captured epoch against the live epoch and reject safely (status: 'stale'or'cancelled') instead of mutating a newly loaded row.