X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/6e39d509471fe9b4e2660e0d1631b350d0c66f40..e9397f91ede62d446aed37d23256e8938fc4c335:/docs/output/Ext.tree.TreePanel.html?ds=sidebyside diff --git a/docs/output/Ext.tree.TreePanel.html b/docs/output/Ext.tree.TreePanel.html index 2aeea38d..fe42ec9d 100644 --- a/docs/output/Ext.tree.TreePanel.html +++ b/docs/output/Ext.tree.TreePanel.html @@ -1,114 +1,119 @@ -
Observable
  Component
    BoxComponent
      Container
        Panel
          TreePanel

Class Ext.tree.TreePanel

Package:Ext.tree
Defined In:TreePanel.js
Class:TreePanel
Extends:Panel

The TreePanel provides tree-structured UI representation of tree-structured data.

-

TreeNodes added to the TreePanel may each contain metadata -used by your application in their attributes property.

-

A TreePanel must have a root node before it is rendered. This may either be -specified using the root config option, or using the setRootNode method. -

An example of tree rendered to an existing div:

var tree = new Ext.tree.TreePanel({
-    renderTo: 'tree-div',
-    useArrows: true,
-    autoScroll: true,
-    animate: true,
-    enableDD: true,
-    containerScroll: true,
-    border: false,
-    // auto create TreeLoader

-    dataUrl: 'get-nodes.php',
-
-    root: {
-        nodeType: 'async',
-        text: 'Ext JS',
-        draggable: false,
-        id: 'source'
-    }
-});
-
-tree.getRootNode().expand();
-

The example above would work with a data packet similar to this:

[{
-    "text": "adapter",
-    "id": "source\/adapter",
-    "cls": "folder"
-}, {
-    "text": "dd",
-    "id": "source\/dd",
-    "cls": "folder"
-}, {
-    "text": "debug.js",
-    "id": "source\/debug.js",
-    "leaf": true,
-    "cls": "file"
-}]
-

An example of tree within a Viewport:

new Ext.Viewport({
-    layout: 'border',
-    items: [{
-        region: 'west',
-        collapsible: true,
-        title: 'Navigation',
-        xtype: 'treepanel',
-        width: 200,
-        autoScroll: true,
-        split: true,
-        loader: new Ext.tree.TreeLoader(),
-        root: new Ext.tree.AsyncTreeNode({
-            expanded: true,
-            children: [{
-                text: 'Menu Option 1',
-                leaf: true
-            }, {
-                text: 'Menu Option 2',
-                leaf: true
-            }, {
-                text: 'Menu Option 3',
-                leaf: true
-            }]
-        }),
-        rootVisible: false,
-        listeners: {
-            click: function(n) {
-                Ext.Msg.alert('Navigation Tree Click', 'You clicked: "' + n.attributes.text + '"');
-            }
-        }
-    }, {
-        region: 'center',
-        xtype: 'tabpanel',
-        // remaining code not shown ...

-    }]
-});

Config Options

Config OptionsDefined By