Skip to content

Commit 6709846

Browse files
committed
Merge pull request #5018 from AdiDahan/fix-3646
feature(treeGrid): fix #3646 - allow to disable expand all button
2 parents 74ef171 + 0c044ca commit 6709846

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

src/features/tree-base/js/tree-base.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,16 @@
525525
* <br/>Defaults to {}
526526
*/
527527
gridOptions.treeCustomAggregations = gridOptions.treeCustomAggregations || {};
528+
529+
/**
530+
* @ngdoc object
531+
* @name enableExpandAll
532+
* @propertyOf ui.grid.treeBase.api:GridOptions
533+
* @description Enable the expand all button at the top of the row header
534+
*
535+
* <br/>Defaults to true
536+
*/
537+
gridOptions.enableExpandAll = gridOptions.enableExpandAll !== false;
528538
},
529539

530540

src/features/tree-base/templates/treeBaseHeaderCell.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
<div
33
class="ui-grid-cell-contents"
44
col-index="renderIndex">
5-
<ui-grid-tree-base-expand-all-buttons>
5+
<ui-grid-tree-base-expand-all-buttons
6+
ng-if="grid.options.enableExpandAll">
67
</ui-grid-tree-base-expand-all-buttons>
78
</div>
89
</div>

src/features/tree-base/test/tree-base.spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ describe('ui.grid.treeBase uiGridTreeBaseService', function () {
8686
showTreeRowHeader: true,
8787
showTreeExpandNoChildren: true,
8888
treeRowHeaderAlwaysVisible: true,
89-
treeCustomAggregations: {}
89+
treeCustomAggregations: {},
90+
enableExpandAll: true
9091
});
9192
});
9293
});

0 commit comments

Comments
 (0)