Skip to content

Commit

Permalink
Fixed #9708 - Table not restoring columns when using virtualscroll
Browse files Browse the repository at this point in the history
  • Loading branch information
yigitfindikli committed Jan 4, 2021
1 parent bdd0c0b commit b04aa55
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/components/table/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2143,7 +2143,7 @@ export class Table implements OnInit, AfterViewInit, AfterContentInit, Blockable

if (this.scrollable) {
let headerCols = DomHandler.find(this.containerViewChild.nativeElement, '.p-datatable-scrollable-header-table > colgroup > col');
let bodyCols = DomHandler.find(this.containerViewChild.nativeElement, '.p-datatable-scrollable-body table > colgroup > col');
let bodyCols = this.virtualScroll ? DomHandler.find(this.containerViewChild.nativeElement, 'cdk-virtual-scroll-viewport table > colgroup > col') : DomHandler.find(this.containerViewChild.nativeElement, '.p-datatable-scrollable-body table > colgroup > col');

headerCols.map((col, index) => col.style.width = widths[index] + 'px');
bodyCols.map((col, index) => col.style.width = widths[index] + 'px');
Expand Down

0 comments on commit b04aa55

Please sign in to comment.