# 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

| Property | Type | Description |
| -------- | ---- | ----------- |
| <span id="$implicit"></span>`$implicit` | <code>TValue</code> | The cell value for this column |
| <span id="value"></span>`value` | <code>TValue</code> | The cell value (explicit binding) |
| <span id="row"></span>`row` | <code>TRow</code> | The full row data object |
| <span id="field"></span>`field` | <code>string</code> | Field name being edited |
| <span id="column"></span>`column` | <code>unknown</code> | The column configuration |
| <span id="rowid"></span>`rowId` | <code>string</code> | Stable row identifier (from `getRowId`). Empty string if no `getRowId` is configured. |
| <span id="oncommit"></span>`onCommit` | <code>(value: TValue) =&gt; void</code> | Callback function to commit the edited value. Use with Angular event binding: `(commit)="onCommit($event)"` |
| <span id="oncancel"></span>`onCancel` | <code>() =&gt; void</code> | Callback function to cancel editing. Use with Angular event binding: `(cancel)="onCancel()"` |
| <span id="updaterow"></span>`updateRow` | <code>(changes: Partial&lt;TRow&gt;) =&gt; void</code> | Update other fields in this row while the editor is open. Changes trigger `cell-change` events with source `'cascade'`. |
| `onValueChange?` | <code>(callback: (newValue: TValue) =&gt; void) =&gt; void</code> | Register a callback to receive value updates when the cell is modified externally (e.g., via `updateRow()` from another cell's commit). |
| `control?` | <code>AbstractControl&lt;any, any, any&gt;</code> | The FormControl for this cell, if the grid is bound to a FormArray with FormGroups. |

### Property Details

#### `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`

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:
```html
<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

---
