Dear All,
Can you please provide one dhtmlxtree and struts2 example.Instead of Tree following xml rendering on my jsp page.Can u suggest me where i need to amend my code.I have display this tree on my layout cell.
<?xml version="1.0" encoding="UTF-8" ?>
- <tree id="0">
- <item text="Physics" id="work console" im0="folderClosed.gif" im1="folderOpen.gif" im2="folderClosed.gif">
<item text="Chemistry" id="working" im0="book_titel.gif" im1="fbook.gif" im2="book_titel.gif" />
<item text="Maths" id="working" im0="book_titel.gif" im1="fbook.gif" im2="book_titel.gif" />
</item>
</tree>
javascript code
<script type="text/javascript">
var dhxLayout = new dhtmlXLayoutObject(document.body, "4E", skin);
dhxLayout.cells("c").attachURL("loadBookLib.do");
dhxLayout.cells("a").attachObject("formTree");
dhxLayout.cells("b").attachObject("TreeDiv");
//dhxLayout.cells("d").attachObject("ftrLayt");
dhxLayout.cells("a").hideHeader();
dhxLayout.cells("b").hideHeader();
dhxLayout.cells("c").hideHeader();
//dhxLayout.cells("d").hideHeader();
dhxLayout.cells("a").setHeight(68);
dhxLayout.cells("b").setHeight(9);
dhxLayout.cells("c").setHeight(500);
//dhxLayout.cells("d").setHeight(10);
dhxLayout.cells("a").fixSize(true, true);
dhxLayout.cells("b").fixSize(true, true);
dhxLayout.cells("c").fixSize(true, true);
//dhxLayout.cells("d").fixSize(true, true);
var arr=[];
arr["a"] = dhxLayout.cells("a").getHeight();
arr["b"] = dhxLayout.cells("b").getHeight();
arr["c"] = dhxLayout.cells("c").getHeight();
//arr["d"] = dhxLayout.cells("d").getHeight();
dhxLayout.attachEvent("onExpand",function(id){
for(var a in arr){
this.cells(a).setHeight(arr[a]);
}
return true;
})
var menu = new dhtmlXTreeObject("menuObj","100%","100%",0);
menu.setImagePath("resource/imgs/csh_dhx_skyblue/");
menu.enableCheckBoxes(0);
menu.enableDragAndDrop(0);
menu.loadXML("bookMenuLib");
</script>
</body>
</html>