UNPKG

@progress/kendo-angular-treelist

Version:

Kendo UI TreeList for Angular - Display hierarchical data in an Angular tree grid view that supports sorting, filtering, paging, and much more.

46 lines (45 loc) 2.68 kB
/**----------------------------------------------------------------------------------------- * 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"; /** * Represents the column edit-cell template of the TreeList ([see example](slug:editing_template_forms_treelist)). Use this directive to customize the content of edited cells. To define the cell template, nest an `<ng-template>` tag with the `kendoTreeListEditTemplate` directive inside a `<kendo-treelist-column>` tag. * * The template context contains the following fields: * - `column`&mdash;The current column instance. * - `dataItem`&mdash;The current data item. * - `cellContext`&mdash;An object used to pass context information to built-in directives. * - `formGroup`&mdash;The current [`FormGroup`](link:site.data.urls.angular['formgroupapi']). If you use the TreeList inside [Template-Driven Forms](link:site.data.urls.angular['forms']), `formGroup` is `undefined`. * - `isNew`&mdash;The state of the current item. * - `rowIndex`&mdash;The current row index. If inside a new item row, `rowIndex` is `-1`. * * @example * ```html * <kendo-treelist ...> * <kendo-treelist-command-column title="command"> * <ng-template kendoTreeListEditTemplate let-rowIndex="rowIndex"> * {{rowIndex}} * </ng-template> * </kendo-treelist-command-column> * </kendo-treelist> * ``` */ export class EditTemplateDirective { templateRef; constructor(templateRef) { this.templateRef = templateRef; } static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EditTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: EditTemplateDirective, isStandalone: true, selector: "[kendoTreeListEditTemplate]", ngImport: i0 }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EditTemplateDirective, decorators: [{ type: Directive, args: [{ selector: '[kendoTreeListEditTemplate]', standalone: true }] }], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{ type: Optional }] }]; } });