From 12bf2e4c329d16f15c1e6892e3e1d14188e3da21 Mon Sep 17 00:00:00 2001 From: Giorgi Cheishvili Date: Tue, 28 Nov 2023 21:31:07 +0400 Subject: [PATCH] fix(platform): clear table rows on data source changes (#11019) (#11021) --- libs/platform/src/lib/table/table.component.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libs/platform/src/lib/table/table.component.ts b/libs/platform/src/lib/table/table.component.ts index 65938b6c452..61452cbf2bc 100644 --- a/libs/platform/src/lib/table/table.component.ts +++ b/libs/platform/src/lib/table/table.component.ts @@ -1544,6 +1544,15 @@ export class TableComponent /** @hidden */ private _listenToTableRowsPipe(): void { + this._subscriptions.add( + /* + * Reset table when the data source is changed, + * because new data source can have different set of data + */ + this._dataSourceDirective.dataSourceChanged.subscribe(() => { + this._setTableRows([]); + }) + ); this._subscriptions.add( this._dataSourceDirective.items$ .pipe(