@servicemind.tis/tis-smart-table-viewer 2.3.9 → 2.3.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1958,6 +1958,11 @@ class TisSmartTableViewerComponent {
1958
1958
  _table;
1959
1959
  set table(value) {
1960
1960
  this._table = value;
1961
+ // ✅ FIX: When table becomes available, connect it to datasource if it exists
1962
+ if (this._table && this.dataSource) {
1963
+ // Force the table to connect to our datasource
1964
+ this._table.dataSource = this.dataSource;
1965
+ }
1961
1966
  }
1962
1967
  _sort;
1963
1968
  _sortSubscription;
@@ -2105,12 +2110,12 @@ class TisSmartTableViewerComponent {
2105
2110
  if (this.dataLengthSubscription) {
2106
2111
  this.dataLengthSubscription.unsubscribe();
2107
2112
  }
2108
- // ✅ FIX: Disconnect previous dataSource to prevent memory leaks
2109
- if (this.dataSource) {
2110
- this.dataSource.disconnect({});
2113
+ // ✅ FIX: Only create datasource once on initialization
2114
+ // Reusing the same datasource prevents subscription issues
2115
+ if (!this.dataSource) {
2116
+ this.dataSource = new ApiDataSource(this.apiService);
2117
+ // Template binding [dataSource]="dataSource" will handle the connection
2111
2118
  }
2112
- // Create new ApiDataSource
2113
- this.dataSource = new ApiDataSource(this.apiService);
2114
2119
  this.loadingSubscription = this.dataSource.loading$.subscribe(loading => {
2115
2120
  if (!loading) {
2116
2121
  if (this._paginator) {