Skip to content

CellEditor

Interface for cell editor components.

Editor components receive the cell value, row data, and column config as inputs, plus must emit commit and cancel outputs.

import { Component, input, output } from '@angular/core';
import type { CellEditor } from '@toolbox-web/grid-angular';
@Component({
selector: 'app-status-editor',
template: `
<select [value]="value()" (change)="commit.emit($any($event.target).value)">
<option value="active">Active</option>
<option value="inactive">Inactive</option>
</select>
`
})
export class StatusEditorComponent implements CellEditor<Employee, string> {
value = input.required<string>();
row = input.required<Employee>();
column = input<unknown>();
commit = output<string>();
cancel = output<void>();
}
PropertyTypeDescription
value() => TValue | undefinedThe cell value - use input<TValue>() or input.required<TValue>()
row() => TRow | undefinedThe full row data - use input<TRow>() or input.required<TRow>()
column?() => unknownThe column configuration (optional) - use input<unknown>()
commitobjectEmit to commit the new value - use output<TValue>()
cancelobjectEmit to cancel editing - use output<void>()
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