Any Way to allow only one group to be expanded at a time
I have a grid with one level of grouping. Is there any way I can make it so that only one group is expanded at a time?
I overrode the toggleExpanded method in my aggregate method: aggregateTemplate: "<div ng-click="customExpand(row)" ng-style="rowStyle(row)" class="ngAggregate">\r"
But now in my customExpand method, How do I get at all the other groups , so that I can collapse them? $scope.customExpand = function (row) { // first collapse all others... but HOW?
row.toggleExpand();
}
I goy it working http://yetanothersharepointblog.wordpress.com/2014/08/05/making-angular-ng-grid-expand-only-one-group/
Great, thanks for documenting this!
Overwrite main functionality to making angular UI Grid force to expand only one row at a time when expand/collapse bottom clicked..
`toggleRowExpansion: function (rowEntity) { // COMMENT THIS LINES: // var row = grid.getRow(rowEntity); // if (row !== null) { // service.toggleRowExpansion(grid, row); // }
// ADD THIS LINES: var row = grid.getRow(rowEntity); if (row !== null) { var isRowExpanded = row.isExpanded || false; service.collapseAllRows(grid); if(!isRowExpanded) service.toggleRowExpansion(grid, row); } }`
How can we achieve this functionallity in v4.0.7.