Skip to content

TbwEditor

Structural directive for cell editor rendering.

This provides a cleaner syntax for defining custom cell editors without the nested <tbw-grid-column-editor> and <ng-template> boilerplate.

<!-- Instead of this verbose syntax: -->
<tbw-grid-column field="status">
<tbw-grid-column-editor>
<ng-template let-value let-onCommit="onCommit" let-onCancel="onCancel">
<app-status-editor [value]="value" (commit)="onCommit($event)" (cancel)="onCancel()" />
</ng-template>
</tbw-grid-column-editor>
</tbw-grid-column>
<!-- Use this cleaner syntax (with auto-wiring - no explicit bindings needed!): -->
<tbw-grid-column field="status">
<app-status-editor *tbwEditor="let value" [value]="value" />
</tbw-grid-column>

The structural directive provides the same context as GridColumnEditor:

  • $implicit / value: The cell value
  • row: The full row data object
  • column: The column configuration
  • onCommit: Callback function to commit the new value (optional - auto-wired if component emits commit event)
  • onCancel: Callback function to cancel editing (optional - auto-wired if component emits cancel event)
import { TbwEditor } from '@toolbox-web/grid-angular';
@Component({
imports: [TbwEditor],
// ...
})

A callback method that performs custom clean-up, invoked immediately before a directive, pipe, or service instance is destroyed.

ngOnDestroy(): void

Static type guard for template context. Uses any defaults for ergonomic template usage.

ngTemplateContextGuard(dir: TbwEditor, ctx: unknown): ctx
NameTypeDescription
dirTbwEditor
ctxunknown

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