Skip to content

Commit

Permalink
Frozen cannot be used in constructor due to lifecycle hooks since it'…
Browse files Browse the repository at this point in the history
…s an input.
  • Loading branch information
JacobSiegle committed Oct 2, 2018
1 parent 6b470f8 commit cdd333b
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/app/components/table/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1886,16 +1886,6 @@ export class ScrollableView implements AfterViewInit,OnDestroy,AfterViewChecked
});
});
}

if (this.frozen) {
this.columnsSubscription = this.dt.tableService.columnsSource$.subscribe(() => {
this.zone.runOutsideAngular(() => {
setTimeout(() => {
this.setScrollHeight();
}, 50);
});
});
}

this.initialized = false;
}
Expand Down Expand Up @@ -1944,6 +1934,16 @@ export class ScrollableView implements AfterViewInit,OnDestroy,AfterViewChecked
this.setScrollHeight();
this.alignScrollBar();

if (this.frozen) {
this.columnsSubscription = this.dt.tableService.columnsSource$.subscribe(() => {
this.zone.runOutsideAngular(() => {
setTimeout(() => {
this.setScrollHeight();
}, 50);
});
});
}

if(this.dt.virtualScroll) {
this.setVirtualScrollerHeight();
}
Expand Down

0 comments on commit cdd333b

Please sign in to comment.