@@ -147,6 +147,32 @@ appears when you quickly scroll through the grid.
147147 $scope.gridOptions.data = data;
148148 });
149149 }]);
150+ app.controller('FourthCtrl', ['$scope', '$http', '$log', function ($scope, $http, $log) {
151+ $scope.gridOptions = {
152+ enableRowSelection: true,
153+ expandableRowTemplate: 'expandableRowTemplate.html',
154+ expandableRowHeight: 150
155+ }
156+
157+ $scope.gridOptions.columnDefs = [
158+ { name: 'id', pinnedLeft:true },
159+ { name: 'name'},
160+ { name: 'age'},
161+ { name: 'address.city'}
162+ ];
163+
164+ $http.get('/data/500_complex.json')
165+ .success(function(data) {
166+ for(i = 0; i < data.length; i++){
167+ data[i].subGridOptions = {
168+ columnDefs: [ {name:"Id", field:"id"},{name:"Name", field:"name"} ],
169+ data: data[i].friends,
170+ disableRowExpandable : (i % 2 === 0)
171+ }
172+ }
173+ $scope.gridOptions.data = data;
174+ });
175+ }]);
150176 </file>
151177 <file name="index.html">
152178 <div ng-controller="MainCtrl">
@@ -164,6 +190,10 @@ appears when you quickly scroll through the grid.
164190 <div ng-controller="ThirdCtrl">
165191 <div ui-grid="gridOptions" ui-grid-expandable class="grid"></div>
166192 </div>
193+ Toggle expand subGrid control
194+ <div ng-controller="FourthCtrl">
195+ <div ui-grid="gridOptions" ui-grid-expandable class="grid"></div>
196+ </div>
167197 </file>
168198 <file name="main.css">
169199 .grid {
0 commit comments