dhtmlxtreeの一般的な使い方

1572 ワード

<div id="treeboxbox_tree" style="width:200px; height:218px;background-color:#f5f5f5;border :1px solid Silver;"></div>
<script>
var tree = new dhtmlXTreeObject("treeboxbox_tree", "100%", "100%", 0);
tree.setSkin('dhx_skyblue');
tree.setImagePath("<s:url value='/js/codebase/imgs/'/>");
//tree.enableDragAndDrop(0);
//tree.enableTreeLines(false);
//tree.setImageArrays("plus", "", "", "", "plus.gif");
//tree.setImageArrays("minus", "", "", "", "minus.gif");
//tree.setStdImages("book.gif", "books_open.gif", "books_close.gif");
//tree.setXMLAutoLoading("../common/tree4.xml");
tree.loadXML("tree4.xml");
tree.setOnClickHandler(doOnClick);
</script>
 
 
<script>
	function doOnClick(id){ 
		var url = tree.getUserData(id,"file");// ID userdata  
		if(url!=null&&url!=''){
			parent.mainFrame.location=url;// .RightFrame.  = url 
		}
	} 
</script>

 
 
<item text=" " id="xtgl_szcdgl" >
	<userdata name="file">../../dictionary/dictionary.action</userdata>
</item>