Skip to content
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

collapse tree when it appears #96

Open
reviliell opened this issue Jan 28, 2016 · 1 comment
Open

collapse tree when it appears #96

reviliell opened this issue Jan 28, 2016 · 1 comment

Comments

@reviliell
Copy link

Thank you for such a nice nav-tree.
I'm not really good at js and have a question:
function loadCompleted(result) { $scope.tree = result.data; $scope.tree_ctrl = {}; }
Here is my function for success webApi data request and my tree is look good but i want it will be collapsed, when it appears
When i'm doing a button with ng-click="tree_ctrl.collapse_all()" - it works ok, but i can't collapse my tree when it appears
Could you help me how to do it?

@azerafati
Copy link

I guess you only need to wait for the tree to be rendered with angular and then command it to collapse or expand.
So this should work $timeout(function(){$scope.tree_ctrl.expand_all();});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants