From 1c666115f59383553ab7898adf81a0a7de83b8f5 Mon Sep 17 00:00:00 2001 From: ark_65 Date: Tue, 28 Mar 2023 10:04:00 +0800 Subject: [PATCH] fix: fix failed to add class dynamically from ngx-gantt-column component (#340) --- .../components/table/body/gantt-table-body.component.html | 2 +- .../src/components/table/body/gantt-table-body.component.ts | 1 - packages/gantt/src/table/gantt-column.component.ts | 5 ++++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/gantt/src/components/table/body/gantt-table-body.component.html b/packages/gantt/src/components/table/body/gantt-table-body.component.html index 9c03eb31..79427641 100644 --- a/packages/gantt/src/components/table/body/gantt-table-body.component.html +++ b/packages/gantt/src/components/table/body/gantt-table-body.component.html @@ -52,7 +52,7 @@ [ngTemplateOutletContext]="{ $implicit: item.origin, item: item.origin }" > -
+
{ this.hasExpandIcon = false; this.columns.forEach((column) => { - // column.classList.add('gantt-table-column'); if (!column.columnWidth) { column.columnWidth = coerceCssPixelValue(defaultColumnWidth); } diff --git a/packages/gantt/src/table/gantt-column.component.ts b/packages/gantt/src/table/gantt-column.component.ts index 682c5ea8..d0b39fc1 100644 --- a/packages/gantt/src/table/gantt-column.component.ts +++ b/packages/gantt/src/table/gantt-column.component.ts @@ -3,7 +3,10 @@ import { coerceCssPixelValue } from '@angular/cdk/coercion'; import { GanttUpper, GANTT_UPPER_TOKEN } from '../gantt-upper'; @Component({ selector: 'ngx-gantt-column', - template: '' + template: '', + host: { + class: 'gantt-table-column' + } }) export class NgxGanttTableColumnComponent { public columnWidth: string;