Skip to content

UpdateSource

Indicates the origin of a data change. Used to prevent infinite loops in cascade update handlers.

  • 'user': Direct user interaction via EditingPlugin (typing, selecting)
  • 'cascade': Triggered by updateRow() in an event handler
  • 'api': External programmatic update via grid.updateRow()
type UpdateSource = "user" | "cascade" | "api"
grid.on('cell-change', (detail) => {
const { source, field, newValue } = detail;
// Only cascade updates for user edits
if (source === 'user' && field === 'price') {
// Update calculated field (marked as 'cascade')
grid.updateRow(detail.rowId, {
total: newValue * detail.row.quantity,
});
}
// Ignore cascade updates to prevent infinite loops
if (source === 'cascade') return;
});
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