-
Notifications
You must be signed in to change notification settings - Fork 33
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
jstree instance #22
Comments
"To invoke a method on an instance you must obtain a reference of the instance and invoke the method". manageInstance: function (s, e, a) {
if (a.treeInstance) {
// Using the first way to invoke method on instance
s[a.treeInstance] = this.tree.jstree(true);
}
} then treeDir.manageInstance(s, e, a); Setup attribute in view <js-tree tree-instance="myTree" ...> Access instance and invoke jstree method in controller $scope.myTree.open_node('node_1'); List of available method for jstree: https://www.jstree.com/api/#/?q=( |
Thank you, that's what I was looking for! Really useful to get the getSelected() method inside angular. |
Thanks. |
Actually since there is some activity on this thread I will add a better method: you can access it inside the scope as follow:
|
Hi, is there any way to retrieve the jstree instance in the controller so that I can use the jsTree API?
My problem is that I have multiple trees in a page and when I select one folder I would like to deselect any selected folder in the other trees. I think it could work by calling the "deselect_all" method in each tree.
It would be good if you could bind the instance with a scope variable:
Thanks.
The text was updated successfully, but these errors were encountered: