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

Expand tree while clicking on text #61

Open
vinayakvinay opened this issue Jul 5, 2016 · 4 comments
Open

Expand tree while clicking on text #61

vinayakvinay opened this issue Jul 5, 2016 · 4 comments

Comments

@vinayakvinay
Copy link

Hi there,
How do I expand tree nodes while clicking on the text instead of folder icon.

@eu81273

@awadhesh22791
Copy link

awadhesh22791 commented Aug 31, 2016

Hi,
I have solved this issue hope it will be helpful to you. I have update the file angular.treeview.min.js

!function(a){"use strict";a.module("angularTreeview",[]).directive("treeModel",["$compile",function(a){return{restrict:"A",link:function(b,c,d){var e=d.treeId,f=d.treeModel,g=d.nodeId||"id",h=d.nodeLabel||"label",i=d.nodeChildren||"children",j='<ul><li data-ng-repeat="node in '+f+'"><i class="collapsed" data-ng-show="node.'+i+'.length && node.collapsed" data-ng-click="'+e+'.selectNodeHead(node)"></i><i class="expanded" data-ng-show="node.'+i+'.length && !node.collapsed" data-ng-click="'+e+'.selectNodeHead(node)"></i><i class="normal" data-ng-hide="node.'+i+'.length"></i> <span data-ng-class="node.selected" data-ng-click="'+e+".selectNodeLabel(node);"+e+'.selectNodeHead(node)">{{node.'+h+'}}</span><div data-ng-hide="node.collapsed" data-tree-id="'+e+'" data-tree-model="node.'+i+'" data-node-id='+g+" data-node-label="+h+" data-node-children="+i+"></div></li></ul>";e&&f&&(d.angularTreeview&&(b[e]=b[e]||{},b[e].selectNodeHead=b[e].selectNodeHead||function(a){a.collapsed=!a.collapsed},b[e].selectNodeLabel=b[e].selectNodeLabel||function(a){b[e].currentNode&&b[e].currentNode.selected&&(b[e].currentNode.selected=void 0),a.selected="selected",b[e].currentNode=a}),c.html("").append(a(j)(b)))}}}])}(angular);

@ibnYusrat
Copy link

Awesome solution man! Thanks.

@eviltek2099
Copy link

could you possibly post th un-min version? I would like to learn from this but I can't find where you made the change.

@ibnYusrat
Copy link

@eviltek2099 you can open the code and simply beautify it in atom or any online service.

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

4 participants