@progress/kendo-angular-grid
Version:
Kendo UI Grid for Angular - high performance data grid with paging, filtering, virtualization, CRUD, and more.
82 lines (81 loc) • 3.88 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 { Component, forwardRef, ContentChild, SkipSelf, Host, Optional } from '@angular/core';
import { ColumnBase } from './column-base';
import { CellTemplateDirective } from '../rendering/cell-template.directive';
import { IdService } from '../common/id.service';
import * as i0 from "@angular/core";
import * as i1 from "./column-base";
import * as i2 from "../common/id.service";
/**
* Represents the command columns of the Grid. You have to define the content of the
* column inside an `<ng-template>` tag.
* For more information and examples, refer to the [Command Column Directives](slug:editing_directives_grid#toc-command-column-directives) article.
*
* @example
* ```html
* <kendo-grid [data]="gridData">
* <kendo-grid-column field="ProductID"></kendo-grid-column>
* <kendo-grid-command-column title="command" [width]="220">
* <ng-template kendoGridCellTemplate>
* <button kendoGridEditCommand class="k-primary">Edit</button>
* <button kendoGridRemoveCommand>Remove</button>
* </ng-template>
* </kendo-grid-command-column>
* </kendo-grid>
* ```
*/
export class CommandColumnComponent extends ColumnBase {
parent;
template;
constructor(parent, idService) {
super(parent, idService);
this.parent = parent;
}
get templateRef() {
return this.template ? this.template.templateRef : undefined;
}
/**
* Defines a function that is used to determine the rowspan of each column cell.
*/
set cellRowspan(cellRowspan) {
super.cellRowspan = cellRowspan;
}
get cellRowspan() {
return super.cellRowspan;
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CommandColumnComponent, deps: [{ token: i1.ColumnBase, host: true, optional: true, skipSelf: true }, { token: i2.IdService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: CommandColumnComponent, isStandalone: true, selector: "kendo-grid-command-column", providers: [
{
provide: ColumnBase,
useExisting: forwardRef(() => CommandColumnComponent)
}
], queries: [{ propertyName: "template", first: true, predicate: CellTemplateDirective, descendants: true }], usesInheritance: true, ngImport: i0, template: ``, isInline: true });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CommandColumnComponent, decorators: [{
type: Component,
args: [{
providers: [
{
provide: ColumnBase,
useExisting: forwardRef(() => CommandColumnComponent)
}
],
selector: 'kendo-grid-command-column',
template: ``,
standalone: true
}]
}], ctorParameters: function () { return [{ type: i1.ColumnBase, decorators: [{
type: SkipSelf
}, {
type: Host
}, {
type: Optional
}] }, { type: i2.IdService, decorators: [{
type: Optional
}] }]; }, propDecorators: { template: [{
type: ContentChild,
args: [CellTemplateDirective, { static: false }]
}] } });