javascript - Drag and Drop child node to parent node using angular.treeview and angular ui-sortable -
hi im new angularjs , im using treeview directive angular.treeview matched angular-ui ui-sortable directive
so modified angular.treeview.js , added ui-sortable tag <ul>
tag make work:
//tree template var template = '<ul ui-sortable>' + '<li data-ng-repeat="node in ' + treemodel + '">' + '<i class="collapsed" data-ng-show="node.' + nodechildren + '.length && node.collapsed" data-ng-click="' + treeid + '.selectnodehead(node)"></i>' + '<i class="expanded" data-ng-show="node.' + nodechildren + '.length && !node.collapsed" data-ng-click="' + treeid + '.selectnodehead(node)"></i>' + '<i class="normal" data-ng-hide="node.' + nodechildren + '.length"></i> ' + '<span data-ng-class="node.selected" data-ng-click="' + treeid + '.selectnodelabel(node)">{{node.' + nodelabel + '}}</span>' + '<div data-ng-hide="node.collapsed" data-tree-id="' + treeid + '" data-tree-model="node.' + nodechildren + '" data-node-id=' + nodeid + ' data-node-label=' + nodelabel + ' data-node-children=' + nodechildren + '></div>' + '</li>' + '</ul>';
sample fiddle: http://jsfiddle.net/zg3f9/1/
the problem want child nodes draggable parent or other nodes. can guys me this? thanks!
why not use library supports this? angular-ui-tree, or, if want use html5 drag & drop api, angular-drag-and-drop-lists
Comments
Post a Comment