@rxap/material-table-system 13.1.0 → 13.2.0

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.
@@ -817,7 +817,20 @@ class TableDataSourceDirective {
817
817
  this.dataSource.sort = this.matSort ?? undefined;
818
818
  this.dataSource.filter = tableFilter;
819
819
  this.dataSource.parameters = this.parameters;
820
+ if (this.dataSource instanceof DynamicTableDataSource) {
821
+ this.dataSource.setPaginator(this.paginator, this.id);
822
+ this.dataSource.setSort(this.matSort, this.id);
823
+ this.dataSource.setFilter(tableFilter, this.id);
824
+ this.dataSource.setParameters(this.parameters, this.id);
825
+ }
820
826
  this._subscription.add(this.dataSource.loading$.pipe(tap(loading => this.loading$.next(!!loading))).subscribe());
827
+ // create the id property for the mat table component.
828
+ // the instance of the mat table component is used as viewer object
829
+ // with the set of the id property it is possible to use the same data source
830
+ // instance for multiple table component simultaneously
831
+ // on connect the data source can then use the correct paginator/matSort/tableFilter/parameters instance
832
+ // to create the TableEvent objects
833
+ Reflect.set(this.matTable, 'id', this.id);
821
834
  this.matTable.dataSource = pipeDataSource(this.dataSource, tap(rowList => rowList.forEach((element) => {
822
835
  element.__metadata__ = { loading$: new ToggleSubject() };
823
836
  })));