Skip to content

Commit

Permalink
fix: datatable-scroller width should update on recalculate (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
chintankavathia authored Sep 10, 2024
1 parent bff1034 commit bdab162
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,7 @@ export class DataTableBodyComponent implements OnInit, OnDestroy {
@Input() set columns(val: any[]) {
if (val !== this._columns) {
this._columns = val;
const colsByPin = columnsByPin(val);
this.columnGroupWidths = columnGroupWidths(colsByPin, val);
this.updateColumnGroupWidths();
}
}

Expand Down Expand Up @@ -1012,4 +1011,9 @@ export class DataTableBodyComponent implements OnInit, OnDestroy {
this._draggedRow = undefined;
this._draggedRowElement = undefined;
}

updateColumnGroupWidths() {
const colsByPin = columnsByPin(this._columns);
this.columnGroupWidths = columnGroupWidths(colsByPin, this._columns);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -940,6 +940,11 @@ export class DatatableComponent implements OnInit, DoCheck, AfterViewInit, After
adjustColumnWidths(columns, width);
}

if (this.bodyComponent) {
this.bodyComponent.updateColumnGroupWidths();
this.bodyComponent.cd.markForCheck();
}

return columns;
}

Expand Down

0 comments on commit bdab162

Please sign in to comment.