@@ -53,6 +53,7 @@ are loaded only when that row is expanded. They have a 2 second delay to simula
53
53
$scope.gridOptions = {
54
54
enableSorting: true,
55
55
enableFiltering: true,
56
+ showTreeExpandNoChildren: true,
56
57
columnDefs: [
57
58
{ name: 'name', width: '30%' },
58
59
{ name: 'gender', width: '20%' },
@@ -86,6 +87,7 @@ are loaded only when that row is expanded. They have a 2 second delay to simula
86
87
data[0].$$treeLevel = 0;
87
88
data[1].$$treeLevel = 1;
88
89
data[10].$$treeLevel = 1;
90
+ data[11].$$treeLevel = 1;
89
91
data[20].$$treeLevel = 0;
90
92
data[25].$$treeLevel = 1;
91
93
data[50].$$treeLevel = 0;
@@ -100,6 +102,11 @@ are loaded only when that row is expanded. They have a 2 second delay to simula
100
102
$scope.toggleRow = function( rowNum ){
101
103
$scope.gridApi.treeBase.toggleRowTreeState($scope.gridApi.grid.renderContainers.body.visibleRowCache[rowNum]);
102
104
};
105
+
106
+ $scope.toggleExpandNoChildren = function(){
107
+ $scope.gridOptions.showTreeExpandNoChildren = !$scope.gridOptions.showTreeExpandNoChildren;
108
+ $scope.gridApi.grid.refresh();
109
+ };
103
110
}]);
104
111
</file>
105
112
@@ -108,6 +115,7 @@ are loaded only when that row is expanded. They have a 2 second delay to simula
108
115
<button id="expandAll" type="button" class="btn btn-success" ng-click="expandAll()">Expand All</button>
109
116
<button id="toggleFirstRow" type="button" class="btn btn-success" ng-click="toggleRow(0)">Toggle First Row</button>
110
117
<button id="toggleSecondRow" type="button" class="btn btn-success" ng-click="toggleRow(1)">Toggle Second Row</button>
118
+ <button id="toggleExpandNoChildren" type="button" class="btn btn-success" ng-click="toggleExpandNoChildren()">Toggle Expand No Children</button>
111
119
<div id="grid1" ui-grid="gridOptions" ui-grid-tree-view class="grid"></div>
112
120
</div>
113
121
</file>
0 commit comments