And this is where the confusion comes in. I know by calling mytree.loadXML(file.xml) I can pass in an XML file and life is good. But how do I load my HTML list I’ve created and turn it into a tree? I also see the:
var myHTML = dhtmlXTreeFromHTML(id);
line being referenced, and I’m assuming it will store my HTML list in the ‘myHTML’ variable, but how do I then get it into the tree? I feel like I’m missing a step. There should be a mytree.loadHTML or something like that.
I’ve tried to attach a file that contains the html I created through code but keep getting messages that ‘extension .txt is not allowed’. Oh well, regardless all I did though was build an unsorted list through code and stored it in a variable called ‘myhtml’. I’d now like to have that displayed in a window in a tree format (hopefully). My code looks something like this:
myhtml = “
Office facing
Furniture installation
Interior office
”;
var dhxWins, w1, myTree;
dhxWins = new dhtmlXWindows();
w1 = dhxWins.createWindow(“pred”, 20, 30, 400, 280);
w1.setText(" My Tree");
myTree = w1.attachTree();
myTree.setImagePath("…/js/dhxtree_skyblue/"); //myTree.loadXML("…/js/tree.xml"); //And this is where I’m not sure how to get myHtml into a tree format.
That’s pretty much it, like I said I feel like I’m missing a step here and am making this tougher than it looks. I still need to figure out child nodes, etc so that I can expand and collapse the tree, but getting it to display is the first step