UI: Fix - remove trackBy from dashboard widgets to recreate widget on config changes.

This commit is contained in:
Igor Kulikov 2024-09-19 10:57:12 +03:00
parent 28986fbf6e
commit 1d63932b2b
2 changed files with 1 additions and 5 deletions

View File

@ -66,7 +66,7 @@
</mat-menu> </mat-menu>
<div [class]="dashboardClass" id="gridster-background"> <div [class]="dashboardClass" id="gridster-background">
<gridster #gridster id="gridster-child" [options]="gridsterOpts"> <gridster #gridster id="gridster-child" [options]="gridsterOpts">
<gridster-item #gridsterItem [item]="widget" [class]="{'tb-noselect': isEdit}" *ngFor="let widget of dashboardWidgets; trackBy: trackByWidgetId"> <gridster-item #gridsterItem [item]="widget" [class]="{'tb-noselect': isEdit}" *ngFor="let widget of dashboardWidgets">
<tb-widget-container <tb-widget-container
[gridsterItem]="gridsterItem" [gridsterItem]="gridsterItem"
[widget]="widget" [widget]="widget"

View File

@ -558,10 +558,6 @@ export class DashboardComponent extends PageComponent implements IDashboardCompo
} }
} }
public trackByWidgetId(_index: number, widget: DashboardWidget) {
return widget.widgetId;
}
private scrollToWidget(widget: DashboardWidget, delay?: number) { private scrollToWidget(widget: DashboardWidget, delay?: number) {
const parentElement = this.gridster.el as HTMLElement; const parentElement = this.gridster.el as HTMLElement;
widget.gridsterItemComponent$().subscribe((gridsterItem) => { widget.gridsterItemComponent$().subscribe((gridsterItem) => {