Skip to content

GridEditorContext

Since v0.1.0

Context object passed to the cell editor template. Contains the cell value, row data, column configuration, and commit/cancel functions.

PropertyTypeDescription
$implicitTValueThe cell value for this column
valueTValueThe cell value (explicit binding)
rowTRowThe full row data object
fieldstringField name being edited
columnunknownThe column configuration
rowIdstringStable row identifier (from getRowId). Empty string if no getRowId is configured.
onCommit(value: TValue) => voidCallback function to commit the edited value. Use with Angular event binding: (commit)="onCommit($event)"
onCancel() => voidCallback function to cancel editing. Use with Angular event binding: (cancel)="onCancel()"
updateRow(changes: Partial<TRow>) => voidUpdate other fields in this row while the editor is open. Changes trigger cell-change events with source 'cascade'.
onValueChange?(callback: (newValue: TValue) => void) => voidRegister a callback to receive value updates when the cell is modified externally (e.g., via updateRow() from another cell’s commit).
control?AbstractControl<any, any, any>The FormControl for this cell, if the grid is bound to a FormArray with FormGroups.

Register a callback to receive value updates when the cell is modified externally (e.g., via updateRow() from another cell’s commit).

The framework adapter auto-patches value/$implicit for template editors, but custom components may use this for additional reactivity.


The FormControl for this cell, if the grid is bound to a FormArray with FormGroups.

This allows custom editors to bind directly to the control for validation display:

<input *tbwEditor="let value; control as ctrl"
[formControl]="ctrl"
[class.is-invalid]="ctrl?.invalid && ctrl?.touched" />

Returns undefined if:

  • The grid is not bound to a FormArray
  • The FormArray doesn’t contain FormGroups
  • The field doesn’t exist in the FormGroup