Ext and TreesΒΆ

Layerswitcher for example is example of such TreePanel.

Lets define the TreePanel and root TreeNode, see 08_trees.html example:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
            var rootNode = new Ext.tree.TreeNode({
                    text: "Root node"
                    });

            var treePanel = new Ext.tree.TreePanel({
                    title: "Tree Panel",
                    root: rootNode,
                    width: 250,
                    height: 250,
                    renderTo: Ext.getBody()
            });

Now, append child node to root node:

1
2
3
            rootNode.appendChild(new Ext.tree.TreeNode({
                        text:"first"
                        }));

Previous topic

Ext & Forms

Next topic

HSLayers

This Page