Skip to content

Commit

Permalink
fix(platform): clear table rows on data source changes (#11019)
Browse files Browse the repository at this point in the history
  • Loading branch information
g-cheishvili authored Nov 28, 2023
1 parent b1dbbd3 commit fc9657b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion libs/platform/src/lib/table/table.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1597,6 +1597,15 @@ export class TableComponent<T = any>

/** @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(
Expand Down Expand Up @@ -1851,7 +1860,7 @@ export class TableComponent<T = any>
/** @hidden */
private _calculateVisibleTableRows(): void {
this._tableRowsVisible = this._tableRows.filter((row) => !row.hidden);

console.log({ visible: this._tableRowsVisible, total: this._tableRows });
if (this._virtualScrollDirective?.virtualScroll) {
this._virtualScrollDirective.calculateVirtualScrollRows();
} else {
Expand Down

0 comments on commit fc9657b

Please sign in to comment.