-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcamjundadata-grid.component.ts
More file actions
68 lines (63 loc) · 1.93 KB
/
camjundadata-grid.component.ts
File metadata and controls
68 lines (63 loc) · 1.93 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
68
// data-grid.component.ts (updated parts only)
import { Component, OnInit } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { BpmnLinkRendererComponent } from './bpmn-link-renderer.component';
@Component({
// ... existing template remains the same
})
export class DataGridComponent implements OnInit {
gridOptions: GridOptions;
rowData: any[] = [];
frameworkComponents: any;
constructor(private dialog: MatDialog) {
this.frameworkComponents = {
bpmnLinkRenderer: BpmnLinkRendererComponent
};
this.gridOptions = {
masterDetail: true,
detailCellRendererParams: {
detailGridOptions: {
columnDefs: [
{ field: 'id', headerName: 'ID' },
{ field: 'description', headerName: 'Description' },
{ field: 'value', headerName: 'Value' },
{
field: 'viewWorkflow',
headerName: 'Workflow',
cellRenderer: 'bpmnLinkRenderer'
}
]
},
getDetailRowData: (params) => {
params.successCallback(this.getDetailData(params.data));
}
},
columnDefs: [
{ field: 'name', headerName: 'Name', rowGroup: true },
{ field: 'id', headerName: 'ID' },
{ field: 'status', headerName: 'Status' },
{
field: 'viewWorkflow',
headerName: 'Workflow',
cellRenderer: 'bpmnLinkRenderer'
}
],
defaultColDef: {
sortable: true,
filter: true,
resizable: true
},
context: {
masterData: null // Will be set in row data
}
};
}
ngOnInit() {
this.rowData = [
{ id: 1, name: 'Item 1', status: 'Active', processDefinitionId: 'your-process-definition-id' },
// ... other rows
];
this.gridOptions.context.masterData = this.rowData[0]; // Example, adjust as needed
}
// ... rest of the component remains the same
}