javascript - Angular UI tree content does not appear properly -
am new angular framework. implemented angular ui tree , works fine have alignment issue. consider following code.
<!doctype html> <html> <head> <title></title> <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" /> <link href="angular-ui-tree-master/examples/css/app.css" rel="stylesheet" /> <link href="angular-ui-tree-master/dist/angular-ui-tree.min.css" rel="stylesheet" /> <script src="jquery.min.js"></script> <script src="angular.min.js"></script> <script src="bootstrap/js/bootstrap.js"></script> <script src="angular-ui-tree-master/dist/angular-ui-tree.js"></script> </head> <body> <div ng-app="myapp" ng-controller="myctrl"> <script type="text/ng-template" id="nodes_renderer.html"> <div ui-tree-handle> <span class="col-md-12">{{node.title}}</span> </div> <ol ui-tree-nodes="" ng-model="node.childlink"> <li ng-repeat="node in node.childlink" ui-tree-node ng-include="'nodes_renderer.html'"> </li> </ol> </script> <div ui-tree="treeoptions" class="dd"> <ol ui-tree-nodes="" ng-model="data" id="tree-root"> <li ng-repeat="node in data" ui-tree-node ng-include="'nodes_renderer.html'" data-drag-delay="100"></li> </ol> </div> </div> <script> var myapp = angular.module('myapp', ['ui.tree']); myapp.controller('myctrl', function ($scope) { $scope.toggle = function (scope) { console.log('menu collapse'); scope.toggle(); }; $scope.data = [ { "id": "1", "title": "node1", "childlink": [ { "id": "2", "title": "node 1.1", "childlink": [ { "id": "3", "title": "node 1.1.1", "childlink": [] }, { "id": "4", "title": "node 1.1.2", "childlink": [] } ] }, { "id": "5", "title": "node 1.2", "childlink": [] } ] } ]; }); </script> </body> </html>
i tired without bootstrap(class="col-md-12") works fine , content aligned need works along with bootstrap(class="col-md-12") content not aligned {{node.title}}
in project bootstrap implemented in many places not able override class col-md-12.
//try that....hope it'll work fine.
<!doctype html> <script type="text/ng-template" id="treehierarchi"> <div ui-tree-handle class="tree-node tree-node-content"> <a class="btn btn-success btn-xs" ng-if="item.children && item.children.length > 0" data-nodrag ng-click="toggle(this)"><span class="fa" ng-class="{ 'fa fa-arrow-right': !collapsed, 'fa fa-arrow-down': collapsed }"></span></a> <input type="text" data-ng-model="item.name" /> </div> <ol ui-tree-nodes="" ng-model="item.children" ng-class="{hidden: !collapsed}"> <li ng-repeat="item in item.children" ui-tree-node ng-include="'treehierarchi'"></li> </ol> </script> <div class="panel panel-default"> <div class="panel-heading">your heading</div> <div class="panel-body"> <div class="col-md-7"> <form name="yourform" role="form"> <div class="row"> <div ui-tree data-nodrag id="tree-root"> <ol ui-tree-nodes ng-model="data"> <li ng-repeat="item in data" ui-tree-node ng-include="'treehierarchi'"></li> </ol> </div> </div> </form> </div> </div> </div>
Comments
Post a Comment