如何在双击或单击节点名称时打开/关闭节点?喜欢它在这里工作
the first tree sample – 但有使用jsTree 0.9.8
–
<html> <head> <title> dashboard</title> <script type="text/javascript" src="_lib/jquery.js"></script> <script type="text/javascript" src="jquery.jstree.js"></script> <script type="text/javascript" src="_lib/jstreegrid.js"></script> <script type="text/javascript"> //<![CDATA[ $(document).ready(function(){ var data = [{ data: "basics",attr: {SOF: "<a href=\"http://www.w3schools.com\">Visit W3Schools.com!</a>"},children: [ {data: "login",attr: {run: "run"},children: [ {data: "login",attr: {}} ] },{data: "Academic Year",attr: {}},attr: {filter: "mini",SOF: "<a href=\"http://www.w3schools.com\">Visit W3Schools.com!</a>"}} ] } ] }]; $("div#jstree").jstree({ plugins: ["themes","json_data","grid","dnd"],json_data: {data: data},grid: { columns: [ {width: 220,header: "Group"},{cellClass: "col2",value: "run",width: 40,header: "run"},{cellClass: "col3",value: "filter",header: "filter"},{cellClass: "col4",value: "SOF",width: 450,header: "SOF"} ] },dnd: { drop_finish : function () { },drag_finish : function () { },drag_check : function (data) { return { after : true,before : true,inside : true }; } } }); }); //]]> </script> </head> <body> <div id="jstree"></div> </body> </html>