jstree.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>H+ 后台主题UI框架 - 树形视图</title>
  7. <meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
  8. <meta name="description" content="H+是一个完全响应式,基于Bootstrap3最新版本开发的扁平化主题,她采用了主流的左右两栏式布局,使用了Html5+CSS3等现代技术">
  9. <link rel="shortcut icon" href="favicon.ico"> <link href="css/bootstrap.min.css?v=3.3.7" rel="stylesheet">
  10. <link href="css/font-awesome.css?v=4.4.0" rel="stylesheet">
  11. <link href="css/plugins/jsTree/style.min.css" rel="stylesheet">
  12. <link href="css/animate.css" rel="stylesheet">
  13. <link href="css/style.css?v=4.1.0" rel="stylesheet">
  14. </head>
  15. <body class="gray-bg">
  16. <div class="wrapper wrapper-content animated fadeInRight">
  17. <div class="row">
  18. <div class="col-sm-12">
  19. <div class="ibox float-e-margins">
  20. <div class="ibox-content">
  21. <strong>jsTree</strong>是一个基于jQuery的Tree控件。支持 XML,JSON,Html三种数据源。提供创建,重命名,移动,删除,拖放节点操作。可以自己自定义创建,删除,嵌套,重命名,选择节点的规则。在这些操作上可以添加多种监听事件。
  22. <br>更多信息请访问: <a href="http://www.jstree.com/" target="_blank">http://www.jstree.com/</a>
  23. </div>
  24. </div>
  25. </div>
  26. </div>
  27. <div class="row">
  28. <div class="col-sm-6">
  29. <div class="ibox float-e-margins">
  30. <div class="ibox-title">
  31. <h5>基本示例 <small>使用Font Awesome图标</small></h5>
  32. <div class="ibox-tools">
  33. <a class="collapse-link">
  34. <i class="fa fa-chevron-up"></i>
  35. </a>
  36. <a class="close-link">
  37. <i class="fa fa-times"></i>
  38. </a>
  39. </div>
  40. </div>
  41. <div class="ibox-content">
  42. <div id="jstree1">
  43. <ul>
  44. <li class="jstree-open">H+主题
  45. <ul>
  46. <li>css
  47. <ul>
  48. <li data-jstree='{"type":"css"}'>animate.css</li>
  49. <li data-jstree='{"type":"css"}'>bootstrap.css</li>
  50. <li data-jstree='{"type":"css"}'>style.css</li>
  51. </ul>
  52. </li>
  53. <li>email-templates
  54. <ul>
  55. <li data-jstree='{"type":"html"}'>action.html</li>
  56. <li data-jstree='{"type":"html"}'>alert.html</li>
  57. <li data-jstree='{"type":"html"}'>billing.html</li>
  58. </ul>
  59. </li>
  60. <li>fonts
  61. <ul>
  62. <li data-jstree='{"type":"svg"}'>glyphicons-halflings-regular.eot</li>
  63. <li data-jstree='{"type":"svg"}'>glyphicons-halflings-regular.svg</li>
  64. <li data-jstree='{"type":"svg"}'>glyphicons-halflings-regular.ttf</li>
  65. <li data-jstree='{"type":"svg"}'>glyphicons-halflings-regular.woff</li>
  66. </ul>
  67. </li>
  68. <li class="jstree-open">img
  69. <ul>
  70. <li data-jstree='{"type":"img"}'>profile_small.jpg</li>
  71. <li data-jstree='{"type":"img"}'>angular_logo.png</li>
  72. <li class="text-navy" data-jstree='{"type":"img"}'>html_logo.png</li>
  73. <li class="text-navy" data-jstree='{"type":"img"}'>mvc_logo.png</li>
  74. </ul>
  75. </li>
  76. <li class="jstree-open">js
  77. <ul>
  78. <li data-jstree='{"type":"js"}'>hplus.js</li>
  79. <li data-jstree='{"type":"js"}'>bootstrap.js</li>
  80. <li data-jstree='{"type":"js"}'>jquery-2.1.1.js</li>
  81. <li data-jstree='{"type":"js"}'>jquery-ui.custom.min.js</li>
  82. <li class="text-navy" data-jstree='{"type":"js"}'>jquery-ui-1.10.4.min.js</li>
  83. </ul>
  84. </li>
  85. <li data-jstree='{"type":"html"}'>affix.html</li>
  86. <li data-jstree='{"type":"html"}'>dashboard.html</li>
  87. <li data-jstree='{"type":"html"}'>buttons.html</li>
  88. <li data-jstree='{"type":"html"}'>calendar.html</li>
  89. <li data-jstree='{"type":"html"}'>contacts.html</li>
  90. <li data-jstree='{"type":"html"}'>css_animation.html</li>
  91. <li class="text-navy" data-jstree='{"type":"html"}'>flot_chart.html</li>
  92. <li class="text-navy" data-jstree='{"type":"html"}'>google_maps.html</li>
  93. <li data-jstree='{"type":"html"}'>icons.html</li>
  94. <li data-jstree='{"type":"html"}'>inboice.html</li>
  95. <li data-jstree='{"type":"html"}'>login.html</li>
  96. <li data-jstree='{"type":"html"}'>mailbox.html</li>
  97. <li data-jstree='{"type":"html"}'>profile.html</li>
  98. <li class="text-navy" data-jstree='{"type":"html"}'>register.html</li>
  99. <li data-jstree='{"type":"html"}'>timeline.html</li>
  100. <li data-jstree='{"type":"html"}'>video.html</li>
  101. <li data-jstree='{"type":"html"}'>widgets.html</li>
  102. </ul>
  103. </li>
  104. </ul>
  105. </div>
  106. </div>
  107. </div>
  108. </div>
  109. <div class="col-sm-6">
  110. <div class="ibox float-e-margins">
  111. <div class="ibox-title">
  112. <h5>JSON示例</h5>
  113. <div class="ibox-tools">
  114. <a class="collapse-link">
  115. <i class="fa fa-chevron-up"></i>
  116. </a>
  117. <a class="close-link">
  118. <i class="fa fa-times"></i>
  119. </a>
  120. </div>
  121. </div>
  122. <div class="ibox-content">
  123. <div id="using_json"></div>
  124. </div>
  125. </div>
  126. </div>
  127. </div>
  128. </div>
  129. <!-- 全局js -->
  130. <script src="js/jquery.min.js?v=2.1.4"></script>
  131. <script src="js/bootstrap.min.js?v=3.3.7"></script>
  132. <!-- 自定义js -->
  133. <script src="js/content.js?v=1.0.0"></script>
  134. <!-- jsTree plugin javascript -->
  135. <script src="js/plugins/jsTree/jstree.min.js"></script>
  136. <style>
  137. .jstree-open > .jstree-anchor > .fa-folder:before {
  138. content: "\f07c";
  139. }
  140. .jstree-default .jstree-icon.none {
  141. width: 0;
  142. }
  143. </style>
  144. <script>
  145. $(document).ready(function () {
  146. $('#jstree1').jstree({
  147. 'core': {
  148. 'check_callback': true
  149. },
  150. 'plugins': ['types', 'dnd'],
  151. 'types': {
  152. 'default': {
  153. 'icon': 'fa fa-folder'
  154. },
  155. 'html': {
  156. 'icon': 'fa fa-file-code-o'
  157. },
  158. 'svg': {
  159. 'icon': 'fa fa-file-picture-o'
  160. },
  161. 'css': {
  162. 'icon': 'fa fa-file-code-o'
  163. },
  164. 'img': {
  165. 'icon': 'fa fa-file-image-o'
  166. },
  167. 'js': {
  168. 'icon': 'fa fa-file-text-o'
  169. }
  170. }
  171. });
  172. $('#using_json').jstree({
  173. 'core': {
  174. 'data': [
  175. 'Empty Folder',
  176. {
  177. 'text': 'Resources',
  178. 'state': {
  179. 'opened': true
  180. },
  181. 'children': [
  182. {
  183. 'text': 'css',
  184. 'children': [
  185. {
  186. 'text': 'animate.css',
  187. 'icon': 'none'
  188. },
  189. {
  190. 'text': 'bootstrap.css',
  191. 'icon': 'none'
  192. },
  193. {
  194. 'text': 'main.css',
  195. 'icon': 'none'
  196. },
  197. {
  198. 'text': 'style.css',
  199. 'icon': 'none'
  200. }
  201. ],
  202. 'state': {
  203. 'opened': true
  204. }
  205. },
  206. {
  207. 'text': 'js',
  208. 'children': [
  209. {
  210. 'text': 'bootstrap.js',
  211. 'icon': 'none'
  212. },
  213. {
  214. 'text': 'hplus.min.js',
  215. 'icon': 'none'
  216. },
  217. {
  218. 'text': 'jquery.min.js',
  219. 'icon': 'none'
  220. },
  221. {
  222. 'text': 'jsTree.min.js',
  223. 'icon': 'none'
  224. },
  225. {
  226. 'text': 'custom.min.js',
  227. 'icon': 'none'
  228. }
  229. ],
  230. 'state': {
  231. 'opened': true
  232. }
  233. },
  234. {
  235. 'text': 'html',
  236. 'children': [
  237. {
  238. 'text': 'layout.html',
  239. 'icon': 'none'
  240. },
  241. {
  242. 'text': 'navigation.html',
  243. 'icon': 'none'
  244. },
  245. {
  246. 'text': 'navbar.html',
  247. 'icon': 'none'
  248. },
  249. {
  250. 'text': 'footer.html',
  251. 'icon': 'none'
  252. },
  253. {
  254. 'text': 'sidebar.html',
  255. 'icon': 'none'
  256. }
  257. ],
  258. 'state': {
  259. 'opened': true
  260. }
  261. }
  262. ]
  263. },
  264. 'Fonts',
  265. 'Images',
  266. 'Scripts',
  267. 'Templates',
  268. ]
  269. }
  270. });
  271. });
  272. </script>
  273. <script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>
  274. <!--统计代码,可删除-->
  275. </body>
  276. </html>