-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathtree-grid-summary-export.component.ts
More file actions
36 lines (30 loc) · 1.53 KB
/
tree-grid-summary-export.component.ts
File metadata and controls
36 lines (30 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { Component, ViewChild, inject } from '@angular/core';
import { ColumnType } from 'igniteui-angular/core';
import { IgxTreeGridComponent } from 'igniteui-angular/grids/tree-grid';
import { IgxButtonDirective } from 'igniteui-angular/directives';
import { IgxCellHeaderTemplateDirective, IgxCellTemplateDirective, IgxColumnComponent, IgxExcelExporterOptions, IgxExcelExporterService } from 'igniteui-angular/grids/core';
import { IgxIconComponent } from 'igniteui-angular/icon';
import { ORDERS_DATA } from '../data/orders';
import { IgxPreventDocumentScrollDirective } from '../../directives/prevent-scroll.directive';
import { DatePipe } from '@angular/common';
@Component({
selector: 'app-tree-grid-summary-export',
styleUrls: ['./tree-grid-summary-export.component.scss'],
templateUrl: './tree-grid-summary-export.component.html',
imports: [IgxButtonDirective, IgxTreeGridComponent, IgxPreventDocumentScrollDirective, IgxColumnComponent, IgxCellTemplateDirective, IgxCellHeaderTemplateDirective, IgxIconComponent, DatePipe]
})
export class TreeGridSummaryExportComponent {
private excelExportService = inject(IgxExcelExporterService);
@ViewChild('tGrid', { read: IgxTreeGridComponent, static: true })
public tGrid: IgxTreeGridComponent;
public data;
constructor() {
this.data = ORDERS_DATA;
}
public toggleSummary(column: ColumnType) {
column.hasSummary = !column.hasSummary;
}
public exportButtonHandler() {
this.excelExportService.export(this.tGrid, new IgxExcelExporterOptions('ExportedFile'));
}
}