ui-grid icon indicating copy to clipboard operation
ui-grid copied to clipboard

collapse/expand all rows

Open EricCat opened this issue 12 years ago • 5 comments

I added a button for collapse/expand all rows when group.

  • I use aggregateTemplate <div ng-click="row.toggleExpand()" ng-style="rowStyle(row)" class="ngAggregate"> <span class="ngAggregateText"> {{row.label CUSTOM_FILTERS}} ({{row.totalChildren()}} {{AggItemsLabel}}) </span> <input type="hidden" ng-value="toggle(row)"> <div class="{{row.aggClass()}}"></div> </div>
  • for collapsed: toggle(row) -> row.setExpand(true)
  • for expand: toggle(row) -> row.setExpand(false)
  • But I get the error

[$rootScope:infdig] 10 $digest() iterations reached. Aborting!

How can I handle this error?

EricCat avatar Jun 30 '14 12:06 EricCat

I have the same question to ask. Tried to modify the library directly but failed.

wildscards avatar Jul 28 '14 07:07 wildscards

I have the same problem. I want add a button to collapse or expand all, is it possible?

zozo69 avatar Jul 30 '14 13:07 zozo69

you can try to get access to all aggCache in rowFactory using $scope.GridOptions.ngGrid.rowFactory.aggCache and for every row in aggCache you call toggleExpand() function.

For example.

$scope.expandAllRows = function(){ angular.forEach($scope.GridOptions.ngGrid.rowFactory.aggCache,function(row){ row.toggleExpand(); }); } here is the plunker http://plnkr.co/edit/eK9GtkC3DvpubxS7lj7b?p=preview

xl2401 avatar Aug 15 '14 17:08 xl2401

From looking at the stackOverflow question, it appears that you've identified a solution. Is that correct, and can this be closed?

PaulL1 avatar Sep 07 '14 08:09 PaulL1

More information requested on a relatively old issue, and no further comment for 2 weeks, assuming that issued is resolved.

PaulL1 avatar Sep 20 '14 23:09 PaulL1