The grid (core) ยท console.warn
a structural append/delete needs a single-field rowKey so the optimistic row can be rekeyed to the server id; with a composite or function rowKey the temp key cannot be written back onto the row. Set rowKey to one field name to use add-row / delete-row.
Printed by The grid (core), prefixed [lattice], since 1.26.0.
Warnings reference › grid.structural.compositekey
- Identifier
grid.structural.compositekey- Raised by
- The grid (core)
- Since
- 1.26.0
What happened
Adding a row optimistically means giving it a temporary key and then rewriting that key to the id the server assigns. That rewrite needs to know which field holds the key, and a composite or function rowKey does not say. The row is still added with its temporary key; it simply cannot be rekeyed when the server answers.
The fix
Set rowKey to a single field name for grids that add or delete rows.
The smallest fix
createGrid(el, { rowKey: 'id', edit: { addRow: true } });
Reference
Covered in full at the API reference.