-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Expand All/Collapse ALL Problem with Tree View #3399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Yes, there isn't a check as to whether every tree node is expanded, it drives off whether you clicked expand all or programatically called expand all. I'm not keen to write a check as to whether every node is expanded - that would get expensive. But I would agree that (I think like grouping) if you have expanded all and you collapse something, then expandAll should toggle back to false. |
Fix(treeView): fix #3399 when collapse row expandAll should be unset
When I expand all sub-trees, the master expand/collapse still shows +. It should show - because all sub-trees are already expanded. I might have missed it somewhere in your message. Did you say fixing this will be too expensive and therefore, it won't be fixed or changed? |
Yes. It would mean iterating over the entire tree on every digest cycle to see whether or not every cell is expanded. If we have a very large data set this will be expensive. Most applications don't do this - you only go to a - if someone explicitly clicks the button (or, in our case, calls expand all programatically). |
Is there an option to hide the master expand/collapse button? And would it be feasible to keep a tally for number of expanded/collapsed sub-trees on each expand/collapse action, and then just compare the tally with the total number of sub-trees to show/hide the master expand/collapse button? For now, I think I can just use css to hide the master expand/collapse button. |
There is not currently an option to hide the button. |
@PaulL1 This is actually fixed! I thought you said it would be too expensive to fix... Anyways, it's great. But with the new changes, my decorator is broken, that's a different story... |
Yeah, I did it in a different way that didn't require polling/binding, so performance impact is less. Sent from my iPhone
|
how to know all rows are expanded after calling $scope.gridApi.treeBase.expandAllRows() method? But if i let it loaded data and expanded. After that some seconds, i click button to call scrollTo method. |
None of the above worked for me for all of my grid use cases.
The following works in every case I have tested. DataChangeCallback is called twice (for some unknown reason) on initial page load. The first time, gridApi.grid.treeBase.tree is an object which causes the issue with gridApi.grid.treeBase.tree.forEach above: |
@PaulL1, has this issue been fixed already? |
This issue happens both in the tutorial: http://ui-grid.info/docs/#/tutorial/215_treeView
Or in my plunker: http://plnkr.co/edit/MwhZMkAeioxceQtbChN1?p=preview
When you manually expand individual sub-trees, the Master Tree still shows the + sign. Instead, it should show the - sign, since all sub-trees have been expanded.
Vice Versa for Collapse ALL.
The text was updated successfully, but these errors were encountered: