Commit 60f86e50 by Ooh-Ao

datagrid

parent f3665be7
......@@ -116,7 +116,7 @@ export class DashboardViewerComponent implements OnInit {
if (dashboard) {
if (dashboard.widgets) {
dashboard.widgets.forEach(widget => {
const keysToProcess: Array<keyof WidgetModel> = ['config', 'perspective', 'data'];
const keysToProcess: Array<keyof WidgetModel> = ['config', 'data'];
keysToProcess.forEach(key => {
if ((widget as any)[key] && typeof (widget as any)[key] === 'string') {
try {
......@@ -153,7 +153,7 @@ export class DashboardViewerComponent implements OnInit {
row: widget.y,
col: widget.x,
componentType: this.widgetComponentMap[widget.component],
componentInputs: { config: widget.config || {} },
componentInputs: { config: widget.config || {}, perspective: widget.perspective },
};
});
}
......
......@@ -184,7 +184,9 @@ export class SyncfusionDatagridWidgetComponent extends BaseWidgetComponent imple
onDataBound(args: any): void {
// Apply perspective after data is loaded and rendered, but only once.
if (this.perspective && !this.isPerspectiveApplied) {
this.setWidgetState(this.perspective as string);
setTimeout(() => {
this.setWidgetState(this.perspective as string);
}, 50); // Small delay to ensure rendering is complete
}
}
......
......@@ -93,6 +93,7 @@ export class SyncfusionPivotWidgetComponent extends BaseWidgetComponent implemen
columns: report.columns?.map(c => ({ name: c.name })) || [],
values: report.values?.map(v => ({ name: v.name, type: v.type })) || [],
filters: report.filters?.map(f => ({ name: f.name })) || [],
chartSettings: { chartSeries: { type: (this.pivotview.chartSettings?.chartSeries as any)?.type || (this.chartSettings?.chartSeries as any)?.type } },
};
return JSON.stringify(perspective);
}
......@@ -110,6 +111,10 @@ export class SyncfusionPivotWidgetComponent extends BaseWidgetComponent implemen
values: perspective.values || [],
filters: perspective.filters || [],
};
if (perspective.chartSettings) {
this.chartSettings = perspective.chartSettings;
this.dataSourceSettings.chartSettings = perspective.chartSettings;
}
if (this.pivotview) {
this.pivotview.dataSourceSettings = this.dataSourceSettings;
}
......@@ -134,7 +139,9 @@ export class SyncfusionPivotWidgetComponent extends BaseWidgetComponent implemen
onDataBound(args: any): void {
// Apply perspective after data is loaded and rendered, but only once.
if (this.perspective && !this.isPerspectiveApplied) {
this.setWidgetState(this.perspective as string);
setTimeout(() => {
this.setWidgetState(this.perspective as string);
}, 50); // Small delay to ensure rendering is complete
}
}
......
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