-
Notifications
You must be signed in to change notification settings - Fork 89
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
ivh-TreeView AngularJs Get Node id On Label Click #164
Comments
Hi @drvishnu, Which version ivh-treeview are you using? In version 1 indeed there is no way to use the vars/methods in your controller/scope. So I created a PR to solve this issue #81 and it was released in v2.0.0-alpha.2. then you can access your controller using |
update: The Demo Script :: http://jsbin.com/ropuyeg/edit?html,js,output im using the CDN version .. Now when i tried the function doesnt get invoked. tried to debug in chrome bt breakpoint isnt getting
|
I see, then you need to use this instead: But I'm afraid the dist files are not updated, they are still the ones generated from v1. @jtrussell maybe you can generate the dist files for v2? |
I just updated the dist files in v2.0.0-alpha.3. Apologies for going dark, I've been away for the past couple weeks. I'm still working through ironing out some dev dependency incompatibilities with the new version of node but at least the dist files should be there :). I'll get a new cut soon with the dev deps updated too. |
I believe this is a duplicate of this SO post. Let's continue the conversation there as needed :). |
Ya it was posted on StackExchange bt none replied there and even after adding v2.0.0-alpha.3 my problem isnt solved .... |
No worries, I only closed this issue as we tend to prefer keeping usage questions on SO. I've posted an answer over there. Let me know if anything is not clear and I'd be happy to go deeper. |
Im new to AngularJs and I have used Angular Ivh_treeview component for displaying a nested tree from JSON data. The Tree is loaded correctly. Now i want to
Get the Node Id On Label Click . So for a trial i tried to make an alert box so that i can check if function call works. Ivh-Treeviewe has only checkbox functions. So tried to Add a Custom Template
nodeTpl: [ '<div>', '<span ivh-treeview-toggle>', '<span ivh-treeview-twistie></span>', '</span>', '<span href="#here" class="ivh-treeview-node-label" ng-click="test()">', '{{trvw.label(node)}}', '</span>', '<div ivh-treeview-children></div>', '</div>' ].join('\n')
and on controller
this.test = function() { alert("hello"); }
Bt now the click event isnt invoked. Can some one please resolve this . Also tried to do with $scope.test definition bt it didnt worked.
The text was updated successfully, but these errors were encountered: