Skip to content

Commit

Permalink
fix: fix failed to add class dynamically from ngx-gantt-column compon…
Browse files Browse the repository at this point in the history
…ent (#340)
  • Loading branch information
ark-65 authored Mar 28, 2023
1 parent 13fff38 commit 1c66611
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
[ngTemplateOutletContext]="{ $implicit: item.origin, item: item.origin }"
></ng-template>

<div class="gantt-table-column" *ngFor="let column of columns; let first = first" [style.width]="column.columnWidth">
<div [classList]="column.classList" *ngFor="let column of columns; let first = first" [style.width]="column.columnWidth">
<!-- drag icon -->
<gantt-icon
*ngIf="first && draggable"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ export class GanttTableBodyComponent implements OnInit, OnDestroy, AfterViewInit
this.columns.changes.pipe(startWith(this.columns), takeUntil(this.destroy$)).subscribe(() => {
this.hasExpandIcon = false;
this.columns.forEach((column) => {
// column.classList.add('gantt-table-column');
if (!column.columnWidth) {
column.columnWidth = coerceCssPixelValue(defaultColumnWidth);
}
Expand Down
5 changes: 4 additions & 1 deletion packages/gantt/src/table/gantt-column.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1c66611

Please sign in to comment.