Skip to content

Commit

Permalink
Merge pull request angular-ui#5018 from AdiDahan/fix-3646
Browse files Browse the repository at this point in the history
feature(treeGrid): fix angular-ui#3646 - allow to disable expand all button
  • Loading branch information
swalters committed Jan 30, 2016
2 parents 74ef171 + 0c044ca commit 6709846
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
10 changes: 10 additions & 0 deletions src/features/tree-base/js/tree-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,16 @@
* <br/>Defaults to {}
*/
gridOptions.treeCustomAggregations = gridOptions.treeCustomAggregations || {};

/**
* @ngdoc object
* @name enableExpandAll
* @propertyOf ui.grid.treeBase.api:GridOptions
* @description Enable the expand all button at the top of the row header
*
* <br/>Defaults to true
*/
gridOptions.enableExpandAll = gridOptions.enableExpandAll !== false;
},


Expand Down
3 changes: 2 additions & 1 deletion src/features/tree-base/templates/treeBaseHeaderCell.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<div
class="ui-grid-cell-contents"
col-index="renderIndex">
<ui-grid-tree-base-expand-all-buttons>
<ui-grid-tree-base-expand-all-buttons
ng-if="grid.options.enableExpandAll">
</ui-grid-tree-base-expand-all-buttons>
</div>
</div>
3 changes: 2 additions & 1 deletion src/features/tree-base/test/tree-base.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ describe('ui.grid.treeBase uiGridTreeBaseService', function () {
showTreeRowHeader: true,
showTreeExpandNoChildren: true,
treeRowHeaderAlwaysVisible: true,
treeCustomAggregations: {}
treeCustomAggregations: {},
enableExpandAll: true
});
});
});
Expand Down

0 comments on commit 6709846

Please sign in to comment.