A simple example of how to do a dtree using a dynamic spanning tree will be demonstrated with DWR
1, the introduction of the desired style and JS
<link rel= "stylesheet" type= "Text/css" href= "css/dtree.css" ><script type= "Text/javascript" src= "js/ Dtree.js "></script>
2. Add the following code to the body
<p><a href= "Javascript:d.openall ()" > Open All </a> | <a href= "Javascript:d.closeall ()" > Close all </a></p> <script type= "Text/javascript" >varD =NewDtree (' d '); D.config.usecookies=false;//do not use cookiesD.config.usestatustxt =true;//status bar display textD.config.closesamelevel =true;//Close other nodes at the same level //RootD.add (0,-1, "North Wind network customer relationship management system"); //Level navigationD.add (1, 0, "Customer information"); D.add (2, 0, "customer service"); D.add (3,0, "Schedule/task"); //Level Two navigationD.add (11,1, "customer"); D.add (12,1, "Contact"); D.add (21,2, "Customer complaints"); D.add (22,2, "Complaint filling"); D.add (31,3, "Schedule"); D.add (32,3, "mission"); <!--This sentence is key--document.write (d); </script>
Note: This is just a static implementation and will be used later with DWR to implement a dynamic tree
D.add (own ID, parent ID, own name);
Simple use of dtree