AllDocs

Last modified by Admin on 2008/12/08 08:19

Documents on this Wiki

<script type="text/javascript"> //<![CDATA[ var tree; function loadNodeData(node, fnLoadComplete) {   var url = "/xwiki/bin/view/XWiki/Treeview?xpage=plain&nodeName="+node.label; var callback = { success: function(oResponse) {      var xml = oResponse.responseXML; var results = xml.getElementsByTagName('results')[0].childNodes; for (var i = 0; i < results.length; i++) if (results[i].hasChildNodes()) { 	 var nodeObject = {label: results[i].getAttribute('label'), href: results[i].childNodes[0].nodeValue}; var tempNode = new YAHOO.widget.TextNode(nodeObject, node, false); }      oResponse.argument.fnLoadComplete(); }, failure: function(oResponse) { 	oResponse.argument.fnLoadComplete(); }, argument: { 	 "node": node, "fnLoadComplete": fnLoadComplete }, timeout: 7000 }; YAHOO.util.Connect.asyncRequest('GET', url, callback); }
 function buildTree() {
 var tree = new YAHOO.widget.TreeView("treeview"); //turn dynamic loading on for entire tree: tree.setDynamicLoad(loadNodeData, 1); var root = tree.getRoot();  // Add spaces as top level nodes   nodeObject = { label: "Blog", href:"/xwiki/bin/view/Blog/" }; var spaceNode = new YAHOO.widget.TextNode(nodeObject, root, false);    nodeObject = { label: "Main", href:"/xwiki/bin/view/Main/" }; var spaceNode = new YAHOO.widget.TextNode(nodeObject, root, false);    nodeObject = { label: "Main.Dashboard", href:"/xwiki/bin/view/Main/Dashboard/" }; var spaceNode = new YAHOO.widget.TextNode(nodeObject, root, false);      nodeObject = { label: "Photos", href:"/xwiki/bin/view/Photos/" }; var spaceNode = new YAHOO.widget.TextNode(nodeObject, root, false);    nodeObject = { label: "Sandbox", href:"/xwiki/bin/view/Sandbox/" }; var spaceNode = new YAHOO.widget.TextNode(nodeObject, root, false);    nodeObject = { label: "Scheduler", href:"/xwiki/bin/view/Scheduler/" }; var spaceNode = new YAHOO.widget.TextNode(nodeObject, root, false);    nodeObject = { label: "Stats", href:"/xwiki/bin/view/Stats/" }; var spaceNode = new YAHOO.widget.TextNode(nodeObject, root, false);    nodeObject = { label: "XAppClasses", href:"/xwiki/bin/view/XAppClasses/" }; var spaceNode = new YAHOO.widget.TextNode(nodeObject, root, false);    nodeObject = { label: "XAppSheets", href:"/xwiki/bin/view/XAppSheets/" }; var spaceNode = new YAHOO.widget.TextNode(nodeObject, root, false);    nodeObject = { label: "XAppTemplates", href:"/xwiki/bin/view/XAppTemplates/" }; var spaceNode = new YAHOO.widget.TextNode(nodeObject, root, false);     tree.draw(); }
 //once the DOM has loaded, we can go ahead and set up our tree: Event.observe(window, "load", buildTree); //]]> </script>