X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/c930e9176a5a85509c5b0230e2bff5c22a591432..c8256059947f3aa8f5b0a9a2acf55e2142bb4742:/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 2b6f08cb..6c268dab 100644 --- a/docs/output/Ext.tree.TreePanel.html +++ b/docs/output/Ext.tree.TreePanel.html @@ -1,110 +1,110 @@ -
Properties Methods Events Config Options Direct Link
Observable
  Component
    BoxComponent
      Container
        Panel
          TreePanel

Class Ext.tree.TreePanel

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

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