Hi, Im working on a little app that uses dhxLayout and dhxTree, the tree data is loaded via XML, but im having a problem to determine the “tree id” into the XML.
I’ve read the forum and I found that every example is using it (object constructor, with an ID parameter):
tree = new dhtmlXTreeObject("treeboxbox_tree", "100%", "100%", 0);
tree.setSkin('dhx_skyblue');
tree.setImagePath("../../codebase/imgs/csh_bluebooks/");
tree.loadXML("../common/tree_ud.xml");
But, Im using attachTree instead:
// vars
var dhxLayout;
var dhxCellNav;
var dhxCellDet;
var dhxTree;
// functions
function doInit() {
dhxLayout = new dhtmlXLayoutObject(document.body,"2U");
dhxLayout.progressOn();
dhxCellNav = dhxLayout.cells("a");
dhxCellDet = dhxLayout.cells("b");
dhxTree = dhxCellNav.attachTree();
dhxTree.setSkin("dhx_skyblue");
dhxTree.setImagePath("/lib_pta/dhtmlx/dhtmlxTree/codebase/imgs/csh_bluebooks/");
dhxTree.deleteChildItems(0);
dhxTree.loadXML("/planteigGes/oPTADDMgr.pPTADataLoadNavigator");
dhxLayout.progressOff();
}//fin doInit
So, how do I get rid of the ID for the XML?
<?xml version="1.0" encoding="iso-8859-1"?>
<tree id="0">
<item id="1" text="colors">
<item id="11" text="red" />
<item id="12" text="yellow" />
</item>
<item id="2" text="numbers">
<item id="21" text="one" />
<item id="22" text="two" />
</item>
</tree>
If I put “0” as ID, I get the following error:
Error type: LoadXML
Description: Incorrect XML
And then this one:
Error type: DataStructure
Description: XML refers to not existing parent
TIP: Im working with IE 7.0