Browse Source

Added fix for filters update

pull/14134/head
LeoMorgan113 11 months ago
parent
commit
cf2c1f53b9
  1. 10
      ui-ngx/src/app/modules/home/components/widget/lib/alarm/alarms-table-widget.component.ts
  2. 10
      ui-ngx/src/app/modules/home/components/widget/lib/entity/entities-table-widget.component.ts

10
ui-ngx/src/app/modules/home/components/widget/lib/alarm/alarms-table-widget.component.ts

@ -328,6 +328,16 @@ export class AlarmsTableWidgetComponent extends PageComponent implements OnInit,
this.updateData();
});
this.ctx.aliasController?.filtersChanged.pipe(
takeUntil(this.destroy$)
).subscribe((filters) => {
let currentFilterId = this.ctx.datasources?.[0]?.filterId;
if (this.displayPagination && currentFilterId && filters.includes(currentFilterId)) {
this.paginator.pageIndex = 0;
}
this.updateData();
});
if (this.displayPagination) {
this.sort.sortChange.pipe(takeUntil(this.destroy$)).subscribe(() => this.paginator.pageIndex = 0);
}

10
ui-ngx/src/app/modules/home/components/widget/lib/entity/entities-table-widget.component.ts

@ -263,6 +263,16 @@ export class EntitiesTableWidgetComponent extends PageComponent implements OnIni
this.updateData();
});
this.ctx.aliasController?.filtersChanged.pipe(
takeUntil(this.destroy$)
).subscribe((filters) => {
let currentFilterId = this.ctx.datasources?.[0]?.filterId;
if (this.displayPagination && currentFilterId && filters.includes(currentFilterId)) {
this.paginator.pageIndex = 0;
}
this.updateData();
});
if (this.displayPagination) {
this.sort.sortChange.pipe(takeUntil(this.destroy$)).subscribe(() => this.paginator.pageIndex = 0);
}

Loading…
Cancel
Save