CellCommitDetail
Event detail for cell value commit.
Fired immediately when a cell value is committed. The event is cancelable -
call preventDefault() to reject the change.
Use setInvalid() to mark the cell as invalid without canceling the commit.
Invalid cells can be styled via cellClass and will be highlighted.
Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
row | TRow | The row object (not yet mutated if event is cancelable). |
rowId | string | Stable row identifier (from getRowId). |
field | string | Field name whose value changed. |
oldValue | unknown | Previous value before change. |
value | unknown | New value to be stored. |
rowIndex | number | Index of the row in current data set. |
changedRows | TRow[] | All rows that have at least one committed change (snapshot list). |
changedRowIds | string[] | IDs of changed rows. |
firstTimeForRow | boolean | True if this row just entered the changed set. |
updateRow | (changes: Partial<TRow>) => void | Update other fields in this row. Convenience wrapper for grid.updateRow(rowId, changes, ‘cascade’). Useful for cascade updates (e.g., calculating totals). |
setInvalid | (message: string) => void | Mark this cell as invalid with an optional validation message. The cell remains editable but will be marked with data-invalid attribute. Use cellClass to apply custom styling to invalid cells. |
Property Details
Section titled “Property Details”setInvalid
Section titled “setInvalid”Mark this cell as invalid with an optional validation message.
The cell remains editable but will be marked with data-invalid attribute.
Use cellClass to apply custom styling to invalid cells.
Call with no message to mark as invalid, or pass a message for tooltips/display.
Call clearInvalid() on the plugin to remove the invalid state.
grid.on('cell-commit', (detail) => { if (detail.field === 'email' && !isValidEmail(detail.value)) { detail.setInvalid('Please enter a valid email address'); }});
AI assistants: For complete API documentation, implementation guides, and code examples for this library, see https://raw.githubusercontent.com/OysteinAmundsen/toolbox/main/llms-full.txt