Repository navigation
Expand file tree
/
Copy path2emaillinkdata-grid.component.ts
More file actions
67 lines (63 loc) · 1.96 KB
/
Copy path2emaillinkdata-grid.component.ts
File metadata and controls
67 lines (63 loc) · 1.96 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// data-grid.component.ts (updated parts only)
import { Component, OnInit } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { EmailEditorLinkRendererComponent } from './email-editor-link-renderer.component';
// ... other imports remain the same
@Component({
selector: 'app-data-grid',
template: `
<div style="height: 600px; width: 100%;">
<ag-grid-angular
style="width: 100%; height: 100%;"
class="ag-theme-material"
[gridOptions]="gridOptions"
[rowData]="rowData"
[frameworkComponents]="frameworkComponents"
(gridReady)="onGridReady($event)">
</ag-grid-angular>
</div>
`,
// ... rest of the component decorator remains the same
})
export class DataGridComponent implements OnInit {
gridOptions: GridOptions;
rowData: any[] = [];
frameworkComponents: any;
constructor(private dialog: MatDialog) {
this.frameworkComponents = {
emailEditorLinkRenderer: EmailEditorLinkRendererComponent
};
this.gridOptions = {
masterDetail: true,
detailCellRendererParams: {
detailGridOptions: {
columnDefs: [
{ field: 'id', headerName: 'ID' },
{ field: 'description', headerName: 'Description' },
{ field: 'value', headerName: 'Value' },
{
field: 'emailAction',
headerName: 'Email',
cellRenderer: 'emailEditorLinkRenderer',
width: 200
}
]
},
getDetailRowData: (params) => {
params.successCallback(this.getDetailData(params.data));
}
},
columnDefs: [
{ field: 'name', headerName: 'Name', rowGroup: true },
{ field: 'id', headerName: 'ID' },
{ field: 'status', headerName: 'Status' }
],
defaultColDef: {
sortable: true,
filter: true,
resizable: true
}
};
}
// ... rest of the component remains the same
}