Skip to content

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.

PropertyTypeDescription
rowTRowThe row object (not yet mutated if event is cancelable).
rowIdstringStable row identifier (from getRowId).
fieldstringField name whose value changed.
oldValueunknownPrevious value before change.
valueunknownNew value to be stored.
rowIndexnumberIndex of the row in current data set.
changedRowsTRow[]All rows that have at least one committed change (snapshot list).
changedRowIdsstring[]IDs of changed rows.
firstTimeForRowbooleanTrue if this row just entered the changed set.
updateRow(changes: Partial<TRow>) => voidUpdate other fields in this row. Convenience wrapper for grid.updateRow(rowId, changes, ‘cascade’). Useful for cascade updates (e.g., calculating totals).
setInvalid(message: string) => voidMark 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.

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