From b33533cd60e0296991ed729fabc8fd6bba2f59df Mon Sep 17 00:00:00 2001 From: Yadong Xie Date: Sat, 12 Oct 2019 10:58:21 +0800 Subject: [PATCH] fix(module:table): fix table fixed style when nzData change (#4274) close #4253 --- components/table/nz-table.component.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/components/table/nz-table.component.ts b/components/table/nz-table.component.ts index b8d4761be0f..938a52541cc 100644 --- a/components/table/nz-table.component.ts +++ b/components/table/nz-table.component.ts @@ -112,9 +112,11 @@ export class NzTableComponent implements OnInit, AfterViewInit, OnDestr @Input() nzItemRender: TemplateRef; @ViewChild('renderItemTemplate', { static: true }) itemRenderChild: TemplateRef; + get itemRender(): TemplateRef { return this.nzItemRender || this.itemRenderChild; } + @Input() @InputBoolean() nzFrontPagination = true; @Input() @InputBoolean() nzTemplateMode = false; @Input() @WithConfig(false) @InputBoolean() nzBordered: boolean; @@ -269,6 +271,11 @@ export class NzTableComponent implements OnInit, AfterViewInit, OnDestr this.fitScrollBar(); this.setScrollPositionClassName(); } + if (changes.nzData) { + if (this.platform.isBrowser) { + setTimeout(() => this.setScrollPositionClassName()); + } + } if (changes.nzPageIndex || changes.nzPageSize || changes.nzFrontPagination || changes.nzData) { this.updateFrontPaginationDataIfNeeded(!!(changes.nzPageSize || changes.nzData)); }