@progress/kendo-angular-grid
Version:
Kendo UI Grid for Angular - high performance data grid with paging, filtering, virtualization, CRUD, and more.
44 lines (43 loc) • 2.75 kB
JavaScript
/**-----------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the project root for more information
*-------------------------------------------------------------------------------------------*/
import { Directive, TemplateRef, Optional } from '@angular/core';
import * as i0 from "@angular/core";
/**
* Lets you customize the content of edited cells by providing a column edit-cell template for the Grid ([see example](slug:custom_editors_grid#setting-up-custom-editors)).
* Place an `<ng-template>` tag with the `kendoGridEditTemplate` directive inside a `<kendo-grid-column>` tag to define the template.
*
* The template context includes:
* - `formGroup`—The current [FormGroup](link:site.data.urls.angular['formgroupapi']). This is the default context for template variables using `let-x`, such as `let-formGroup`. If you use the Grid in [Template-Driven Forms](link:site.data.urls.angular['forms']), this is `undefined`.
* - `rowIndex`—The current data row index. For a new item row, `rowIndex` is `-1`. Use `let-rowIndex="rowIndex"` to access it.
* - `dataItem`—The current data item. Use `let-dataItem="dataItem"` to access it.
* - `column`—The current column instance. Use `let-column="column"` to access it.
* - `isNew`—The state of the current item. Use `let-isNew="isNew"` to access it.
*
* @example
* ```html
* <kendo-grid-column>
* <ng-template kendoGridEditTemplate let-formGroup="formGroup" let-dataItem="dataItem">
* <kendo-textbox [formControl]="formGroup.get('field')"></kendo-textbox>
* </ng-template>
* </kendo-grid-column>
* ```
*/
export class EditTemplateDirective {
templateRef;
constructor(templateRef) {
this.templateRef = templateRef;
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: EditTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: EditTemplateDirective, isStandalone: true, selector: "[kendoGridEditTemplate]", ngImport: i0 });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: EditTemplateDirective, decorators: [{
type: Directive,
args: [{
selector: '[kendoGridEditTemplate]',
standalone: true
}]
}], ctorParameters: () => [{ type: i0.TemplateRef, decorators: [{
type: Optional
}] }] });