Skip to content

Source-row editing

Grid cells are aggregates, so editing one is ambiguous — instead you edit the source rows. Click a leaf row to open its master-detail table, click a source cell to edit it, and the engine recomputes every affected aggregate. Edits are addressed by group-key path + row index and pass through server-side validation before the frame mutates (try a revenue over 500 below — it’s rejected).

# The component emits a cell-edit event; a callback applies it via the engine and returns
# refreshed row_data. Validation rules live on the column def.
result = engine.apply_edit(
["region", "country"],
{"path": ["EMEA", "Germany"], "row_index": 0,
"column": "revenue", "old_value": 100, "new_value": 120},
validation_rules={"revenue": [{"type": "range", "min": 0, "max": 500}]},
)

Each column can carry validationRulesrange (min/max), required, regex, or a safe-DSL predicate ({ type: 'predicate', if: 'value > 0' }) tested against the candidate row. A rejected edit leaves the frame untouched, restores the cell, and reports { code, column, rule, message }. Editing a typed column coerces the new value to the column dtype (numeric widening, temporal parsing) — never silently corrupting the column.