-
Notifications
You must be signed in to change notification settings - Fork 299
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
Option to render trees expanded #141
Comments
I would prefer passing an |
+1 That's a much better idea. |
I realize that in my first comment, I had things backwards. Determining the depth of a node from within the expandIf function could still require walking up the tree to count nodes. I suggest that it receives the depth as its second argument. |
Or the nodes can have a depth property that the expandIf function can check. |
If you are using lazy loading, there may be situations where the depth of a record is unknown unless you walk up the tree. |
Doh. I'm an idiot ;) |
I've taken a stab at this with #172. Open to comments for the time being. Thanks @mikerobi for the idea of conditionalizing it. Initially I was very reluctant to entertain the idea of blanket auto-expand, just because I don't like tempting people to use it without considering the consequences (especially if it's being used with a non-memory store, i.e. going back to the server for each request for children). However, it is a request that comes up fairly often, and this also gave me the opportunity to also allow "preserving" of expanded states when rows get unrendered and re-rendered later (either from scrolling or observer-induced remove/insert operations). |
Awesome, I will test this out now. I've been running into more and more problems with reexpanding trees after refreshing them. |
Closing this now, since #172 has been merged. Thanks @swiftdemise for the additional feedback and tire-kicking. |
It would be awesome if we could supply an option in the grid constructor to set the default depth of a tree to be expanded when trees are first rendered. The project I am working on has a few requirements that the trees be expanded by default and I have to currently traverse the tree and expand the nodes manually :(
The text was updated successfully, but these errors were encountered: