-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathcsv-export-sample-1.component.ts
More file actions
39 lines (33 loc) · 1.61 KB
/
Copy pathcsv-export-sample-1.component.ts
File metadata and controls
39 lines (33 loc) · 1.61 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
37
38
39
/* eslint-disable @typescript-eslint/naming-convention */
import { Component, ViewChild, inject } from '@angular/core';
import { IgxGridComponent } from 'igniteui-angular/grids/grid';
import { IgxGridToolbarActionsComponent, IgxGridToolbarComponent, IgxGridToolbarExporterComponent, IgxCsvExporterService } from 'igniteui-angular/grids/core';
import { IgxPreventDocumentScrollDirective } from '../../../directives/prevent-scroll.directive';
@Component({
selector: 'app-csv-export-sample-1',
styleUrls: ['./csv-export-sample-1.component.scss'],
templateUrl: './csv-export-sample-1.component.html',
imports: [IgxGridComponent, IgxPreventDocumentScrollDirective, IgxGridToolbarComponent, IgxGridToolbarActionsComponent, IgxGridToolbarExporterComponent]
})
export class CsvExportSample1Component {
private csvExportService = inject(IgxCsvExporterService);
@ViewChild('igxGrid1', { static: true }) public igxGrid1: IgxGridComponent;
public localData = [
{ Name: 'Eric Ridley', Age: '26' },
{ Name: 'Alanis Brook', Age: '22' },
{ Name: 'Jonathan Morris', Age: '23' }
];
/*
The following code demonstrates how to attach event handlers to exporter specific events
and also how to customize the column export process.
this.csvExportService.columnExporting.subscribe((args: IColumnExportingEventArgs) => {
if (args.header == 'Age' && args.columnIndex == 1) {
args.cancel = true;
}
});
this.csvExportService.rowExporting.subscribe((args: IRowExportingEventArgs) => {
});
this.csvExportService.exportEnded.subscribe((args: ICsvExportEndedEventArgs) => {
});
*/
}