Commit f3665be7 by Ooh-Ao

config

parent 0f9c0dd2
......@@ -289,6 +289,17 @@
</mat-form-field>
<mat-checkbox [(ngModel)]="currentConfig.expandAll" name="expandAll" class="mb-4">Expand All</mat-checkbox>
<mat-form-field appearance="fill" class="w-full">
<mat-label>Display As</mat-label>
<mat-select [(ngModel)]="currentConfig.displayOptionView" name="displayOptionView">
<mat-option value="Both">Both (Grid & Chart)</mat-option>
<mat-option value="Grid">Grid Only</mat-option>
<mat-option value="Chart">Chart Only</mat-option>
</mat-select>
</mat-form-field>
<mat-checkbox [(ngModel)]="currentConfig.showToolbar" name="showToolbar" class="mb-4">Show Toolbar</mat-checkbox>
<!-- Pivot Rows -->
<div class="config-section border p-3 rounded-lg mb-4">
<h3 class="text-lg font-semibold mb-2">Rows</h3>
......
......@@ -76,6 +76,8 @@ export class WidgetConfigComponent implements OnInit {
if (!this.currentConfig.columns) this.currentConfig.columns = [];
if (!this.currentConfig.values) this.currentConfig.values = [];
if (!this.currentConfig.filters) this.currentConfig.filters = [];
if (!this.currentConfig.displayOptionView) this.currentConfig.displayOptionView = 'Both';
if (this.currentConfig.showToolbar === undefined) this.currentConfig.showToolbar = true;
}
if (this.widgetType === 'ChartWidgetComponent' && !this.currentConfig.yFields) {
this.currentConfig.yFields = [];
......
......@@ -54,8 +54,8 @@ export class SyncfusionPivotWidgetComponent extends BaseWidgetComponent implemen
this.widgetId = this.config.widgetId;
this.widgetStateService.registerWidget(this.widgetId, this);
}
this.toolbar = ['Grid', 'Chart', 'Export', 'SubTotal', 'GrandTotal', 'ConditionalFormatting', 'NumberFormatting', 'FieldList'];
this.displayOption = { view: 'Both' } as DisplayOption;
this.toolbar = this.config.showToolbar !== false ? ['Grid', 'Chart', 'Export', 'SubTotal', 'GrandTotal', 'ConditionalFormatting', 'NumberFormatting', 'FieldList'] : [];
this.displayOption = { view: this.config.displayOptionView || 'Both' } as DisplayOption;
}
override ngOnDestroy(): void {
......
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