Browse Source

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

pull/11704/head
Igor Kulikov 2 years ago
parent
commit
1d63932b2b
  1. 2
      ui-ngx/src/app/modules/home/components/dashboard/dashboard.component.html
  2. 4
      ui-ngx/src/app/modules/home/components/dashboard/dashboard.component.ts

2
ui-ngx/src/app/modules/home/components/dashboard/dashboard.component.html

@ -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"

4
ui-ngx/src/app/modules/home/components/dashboard/dashboard.component.ts

@ -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) => {

Loading…
Cancel
Save