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.
Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
$implicit | TValue | The cell value for this column |
value | TValue | The cell value (explicit binding) |
row | TRow | The full row data object |
field | string | Field name being edited |
column | unknown | The column configuration |
rowId | string | Stable row identifier (from getRowId). Empty string if no getRowId is configured. |
onCommit | (value: TValue) => void | Callback function to commit the edited value. Use with Angular event binding: (commit)="onCommit($event)" |
onCancel | () => void | Callback function to cancel editing. Use with Angular event binding: (cancel)="onCancel()" |
updateRow | (changes: Partial<TRow>) => void | Update other fields in this row while the editor is open. Changes trigger cell-change events with source 'cascade'. |
onValueChange? | (callback: (newValue: TValue) => void) => void | Register 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. |
Property Details
Section titled “Property Details”onValueChange
Section titled “onValueChange”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.
control
Section titled “control”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