Commit 74e722aa by Ooh-Ao

persis หน้าวิว

parent 126de83b
......@@ -4,7 +4,7 @@
<div *ngIf="dashboardData" class="dashboard-viewer-container p-4">
<h1 class="text-2xl font-bold mb-4 text-gray-800">{{ dashboardData.thName }}</h1>
<div class="control-section">
<ejs-dashboardlayout id='dashboard_viewer' #viewerLayout [cellSpacing]="cellSpacing" [columns]="6" [allowResizing]="false" [allowDragging]="false">
<ejs-dashboardlayout id='dashboard_viewer' #viewerLayout [cellSpacing]="cellSpacing" [columns]="6" [allowResizing]="false" [allowDragging]="false" [enablePersistence]="true">
<e-panels>
<e-panel *ngFor="let panel of panels" [row]="panel.row" [col]="panel.col" [sizeX]="panel.sizeX" [sizeY]="panel.sizeY" [id]="panel.id">
<ng-template #header>
......
import { Component, OnInit, Type, ChangeDetectorRef } from '@angular/core';
import { Component, OnInit, Type, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ActivatedRoute, RouterModule } from '@angular/router';
import { DashboardLayoutModule, PanelModel } from '@syncfusion/ej2-angular-layouts';
......@@ -55,6 +55,7 @@ export interface DashboardPanel extends PanelModel {
],
templateUrl: './dashboard-viewer.component.html',
styleUrls: ['./dashboard-viewer.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class DashboardViewerComponent implements OnInit {
......@@ -99,6 +100,7 @@ export class DashboardViewerComponent implements OnInit {
private route: ActivatedRoute,
private dashboardDataService: DashboardDataService,
private dashboardStateService: DashboardStateService,
private cdr: ChangeDetectorRef
) { }
ngOnInit(): void {
......@@ -135,6 +137,7 @@ export class DashboardViewerComponent implements OnInit {
if (dashboard.datasetId) {
this.dashboardStateService.selectDataset(dashboard.datasetId);
}
this.cdr.markForCheck(); // Manually trigger change detection
} else {
this.errorMessage = 'Could not load the dashboard.';
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment