dhtmlxtree 常用用法

 

<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>
 

 

你可能感兴趣的:(html)