show icons

Hi,

I am going to use dhtmlxTree.
I download its folders and put them into “web” folder of my web application.
I use the below code, but it doesn’t work.
please let me know what my mistake is.

thanks

JSP Page
    <script>
        var tree = dhtmlXTreeFromHTML("treeboxbox_tree","100%","100%",0); 
        tree.setSkin('dhx_skyblue');
        tree.setImagePath("codebase/imgs/");
        tree.enableHighlighting(true);
    </script>

    <div id="treeboxbox_tree" style="width:250px; height:218px;background-color:#f5f5f5;border :1px solid Silver;">
        <ul>
            <li>Root
                <ul>
                    <li>Child1
                        <ul>
                            <li>Child 1-1</li>
                        </ul>
                    <li>Child2</li>
                   
                </ul>
            </li>
        </ul>
    </div>

</body>

Hi,

you need to move code with Tree initialization after <div id=“treeboxbox_tree”…>… definition or in onload event handler.

I have changed the code…but it doesn’t work…
Do you mean this?

    <div id="treeboxbox_tree" style="width:250px; height:218px;background-color:#f5f5f5;border :1px solid Silver;">
        <ul>
            <li>Root
                <ul>
                    <li>Child1
                        <ul>
                            <li>Child 1-1</li>
                        </ul>
                    <li>Child2</li>
                    <li><b>Bold</b> <i>Italic</i></li>
                </ul>
            </li>
        </ul>
    </div>
    <input type="submit" onclick="fu()" value="add"/>
    <script>
            var tree = dhtmlXTreeFromHTML("treeboxbox_tree","100%","100%",0); 
            tree.setSkin('dhx_skyblue');
            tree.setImagePath("codebase/imgs/");
            tree.enableHighlighting(true);
    </script>

</body>

The path of folder with icons should be set before items are added. You may use setImagePath attribute in the

tag:
...

This approach call be used to call any method of Tree that started with “set” or “enable”. For example, to enable checkboxes you would use: