-
Notifications
You must be signed in to change notification settings - Fork 0
/
notes1.txt
83 lines (72 loc) · 1.55 KB
/
notes1.txt
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
69
70
71
72
73
74
75
76
77
78
79
80
https://stackoverflow.com/questions/32861673/displaying-nested-json-in-ag-grid
Take a look at this updated plunker.
// main.js
var app = angular.module('myApp', ['agGrid']);
app.controller('MyCtrl', ['$scope', '$http',
function($scope, $http) {
$scope.myData = [
{
"defaultColumns1": {"region":"PA"},
"defaultColumns2": {"LocationName": "loc1",
"LegalName": "legName1"},
"name":"name1"
},
{
"defaultColumns1": {"region":"PB"},
"defaultColumns2": {"LocationName": "loc2",
"LegalName": "legName2"},
"name":"name2"
}
];
$scope.gridOptions = {
rowData: $scope.myData,
columnDefs: [
{
headerName: 'Name',
field: 'name'
},
{
headerName: 'Region',
valueGetter: 'data.defaultColumns1.region'
},
{
valueGetter: 'data.defaultColumns2.LocationName',
headerName: 'Location',
headerGroup: 'address'
},
{
valueGetter: 'data.defaultColumns2.LegalName',
headerName: 'Legal Name',
headerGroup: 'address'
},
],
enableColumnResize: true,
groupHeaders : true
};
}]);
/*style.css*/
.gridStyle {
border: 1px solid rgb(212,212,212);
width: 1000px;
height: 200px
}
.container {
margin-top: 20px;
}
.ngGrid {
width: 800px;
}
.ag-header-cell {
background: none repeat scroll 0 0 #53555A;
border: 1px solid #DDDDDD;
color: #FFFFFF;
font-weight: lighter;
line-height: 15px;
}
.ag-header-cell-grouped{
background: none repeat scroll 0 0 #53555A;
border: 1px solid #DDDDDD;
color: #FFFFFF;
font-weight: lighter;
line-height: 15px;
}