-/**\r
- * @class Ext.tree.TreePanel\r
- * @extends Ext.Panel\r
- * <p>The TreePanel provides tree-structured UI representation of tree-structured data.</p>\r
- * <p>{@link Ext.tree.TreeNode TreeNode}s added to the TreePanel may each contain metadata\r
- * used by your application in their {@link Ext.tree.TreeNode#attributes attributes} property.</p>\r
- * <p><b>A TreePanel must have a {@link #root} node before it is rendered.</b> This may either be\r
- * specified using the {@link #root} config option, or using the {@link #setRootNode} method.\r
- * <p>An example of tree rendered to an existing div:</p><pre><code>\r
-var tree = new Ext.tree.TreePanel({\r
- renderTo: 'tree-div',\r
- useArrows: true,\r
- autoScroll: true,\r
- animate: true,\r
- enableDD: true,\r
- containerScroll: true,\r
- border: false,\r
- // auto create TreeLoader\r
- dataUrl: 'get-nodes.php',\r
-\r
- root: {\r
- nodeType: 'async',\r
- text: 'Ext JS',\r
- draggable: false,\r
- id: 'source'\r
- }\r
-});\r
-\r
-tree.getRootNode().expand();\r
- * </code></pre>\r
- * <p>The example above would work with a data packet similar to this:</p><pre><code>\r
-[{\r
- "text": "adapter",\r
- "id": "source\/adapter",\r
- "cls": "folder"\r
-}, {\r
- "text": "dd",\r
- "id": "source\/dd",\r
- "cls": "folder"\r
-}, {\r
- "text": "debug.js",\r
- "id": "source\/debug.js",\r
- "leaf": true,\r
- "cls": "file"\r
-}]\r
- * </code></pre>\r
- * <p>An example of tree within a Viewport:</p><pre><code>\r
-new Ext.Viewport({\r
- layout: 'border',\r
- items: [{\r
- region: 'west',\r
- collapsible: true,\r
- title: 'Navigation',\r
- xtype: 'treepanel',\r
- width: 200,\r
- autoScroll: true,\r
- split: true,\r
- loader: new Ext.tree.TreeLoader(),\r
- root: new Ext.tree.AsyncTreeNode({\r
- expanded: true,\r
- children: [{\r
- text: 'Menu Option 1',\r
- leaf: true\r
- }, {\r
- text: 'Menu Option 2',\r
- leaf: true\r
- }, {\r
- text: 'Menu Option 3',\r
- leaf: true\r
- }]\r
- }),\r
- rootVisible: false,\r
- listeners: {\r
- click: function(n) {\r
- Ext.Msg.alert('Navigation Tree Click', 'You clicked: "' + n.attributes.text + '"');\r
- }\r
- }\r
- }, {\r
- region: 'center',\r
- xtype: 'tabpanel',\r
- // remaining code not shown ...\r
- }]\r
-});\r
-</code></pre>\r
- *\r
- * @cfg {Ext.tree.TreeNode} root The root node for the tree.\r
- * @cfg {Boolean} rootVisible <tt>false</tt> to hide the root node (defaults to <tt>true</tt>)\r
- * @cfg {Boolean} lines <tt>false</tt> to disable tree lines (defaults to <tt>true</tt>)\r
- * @cfg {Boolean} enableDD <tt>true</tt> to enable drag and drop\r
- * @cfg {Boolean} enableDrag <tt>true</tt> to enable just drag\r
- * @cfg {Boolean} enableDrop <tt>true</tt> to enable just drop\r
- * @cfg {Object} dragConfig Custom config to pass to the {@link Ext.tree.TreeDragZone} instance\r
- * @cfg {Object} dropConfig Custom config to pass to the {@link Ext.tree.TreeDropZone} instance\r
- * @cfg {String} ddGroup The DD group this TreePanel belongs to\r
- * @cfg {Boolean} ddAppendOnly <tt>true</tt> if the tree should only allow append drops (use for trees which are sorted)\r
- * @cfg {Boolean} ddScroll <tt>true</tt> to enable body scrolling\r
- * @cfg {Boolean} containerScroll <tt>true</tt> to register this container with ScrollManager\r
- * @cfg {Boolean} hlDrop <tt>false</tt> to disable node highlight on drop (defaults to the value of {@link Ext#enableFx})\r
- * @cfg {String} hlColor The color of the node highlight (defaults to <tt>'C3DAF9'</tt>)\r
- * @cfg {Boolean} animate <tt>true</tt> to enable animated expand/collapse (defaults to the value of {@link Ext#enableFx})\r
- * @cfg {Boolean} singleExpand <tt>true</tt> if only 1 node per branch may be expanded\r
- * @cfg {Object} selModel A tree selection model to use with this TreePanel (defaults to an {@link Ext.tree.DefaultSelectionModel})\r
- * @cfg {Boolean} trackMouseOver <tt>false</tt> to disable mouse over highlighting\r
- * @cfg {Ext.tree.TreeLoader} loader A {@link Ext.tree.TreeLoader} for use with this TreePanel\r
- * @cfg {String} pathSeparator The token used to separate sub-paths in path strings (defaults to <tt>'/'</tt>)\r
- * @cfg {Boolean} useArrows <tt>true</tt> to use Vista-style arrows in the tree (defaults to <tt>false</tt>)\r
- * @cfg {String} requestMethod The HTTP request method for loading data (defaults to the value of {@link Ext.Ajax#method}).\r
- *\r
- * @constructor\r
- * @param {Object} config\r
- * @xtype treepanel\r
- */\r
-Ext.tree.TreePanel = Ext.extend(Ext.Panel, {\r
- rootVisible : true,\r
- animate : Ext.enableFx,\r
- lines : true,\r
- enableDD : false,\r
- hlDrop : Ext.enableFx,\r
- pathSeparator : '/',\r
-\r
- /**\r
- * @cfg {Array} bubbleEvents\r
- * <p>An array of events that, when fired, should be bubbled to any parent container.\r
- * See {@link Ext.util.Observable#enableBubble}.\r
- * Defaults to <tt>[]</tt>.\r
- */\r
- bubbleEvents : [],\r
-\r
- initComponent : function(){\r
- Ext.tree.TreePanel.superclass.initComponent.call(this);\r
-\r
- if(!this.eventModel){\r
- this.eventModel = new Ext.tree.TreeEventModel(this);\r
- }\r
-\r
- // initialize the loader\r
- var l = this.loader;\r
- if(!l){\r
- l = new Ext.tree.TreeLoader({\r
- dataUrl: this.dataUrl,\r
- requestMethod: this.requestMethod\r
- });\r
- }else if(Ext.isObject(l) && !l.load){\r
- l = new Ext.tree.TreeLoader(l);\r
- }\r
- this.loader = l;\r
-\r
- this.nodeHash = {};\r
-\r
- /**\r
- * The root node of this tree.\r
- * @type Ext.tree.TreeNode\r
- * @property root\r
- */\r
- if(this.root){\r
- var r = this.root;\r
- delete this.root;\r
- this.setRootNode(r);\r
- }\r
-\r
-\r
- this.addEvents(\r
-\r
- /**\r
- * @event append\r
- * Fires when a new child node is appended to a node in this tree.\r
- * @param {Tree} tree The owner tree\r
- * @param {Node} parent The parent node\r
- * @param {Node} node The newly appended node\r
- * @param {Number} index The index of the newly appended node\r
- */\r
- 'append',\r
- /**\r
- * @event remove\r
- * Fires when a child node is removed from a node in this tree.\r
- * @param {Tree} tree The owner tree\r
- * @param {Node} parent The parent node\r
- * @param {Node} node The child node removed\r
- */\r
- 'remove',\r
- /**\r
- * @event movenode\r
- * Fires when a node is moved to a new location in the tree\r
- * @param {Tree} tree The owner tree\r
- * @param {Node} node The node moved\r
- * @param {Node} oldParent The old parent of this node\r
- * @param {Node} newParent The new parent of this node\r
- * @param {Number} index The index it was moved to\r
- */\r
- 'movenode',\r
- /**\r
- * @event insert\r
- * Fires when a new child node is inserted in a node in this tree.\r
- * @param {Tree} tree The owner tree\r
- * @param {Node} parent The parent node\r
- * @param {Node} node The child node inserted\r
- * @param {Node} refNode The child node the node was inserted before\r
- */\r
- 'insert',\r
- /**\r
- * @event beforeappend\r
- * Fires before a new child is appended to a node in this tree, return false to cancel the append.\r
- * @param {Tree} tree The owner tree\r
- * @param {Node} parent The parent node\r
- * @param {Node} node The child node to be appended\r
- */\r
- 'beforeappend',\r
- /**\r
- * @event beforeremove\r
- * Fires before a child is removed from a node in this tree, return false to cancel the remove.\r
- * @param {Tree} tree The owner tree\r
- * @param {Node} parent The parent node\r
- * @param {Node} node The child node to be removed\r
- */\r
- 'beforeremove',\r
- /**\r
- * @event beforemovenode\r
- * Fires before a node is moved to a new location in the tree. Return false to cancel the move.\r
- * @param {Tree} tree The owner tree\r
- * @param {Node} node The node being moved\r
- * @param {Node} oldParent The parent of the node\r
- * @param {Node} newParent The new parent the node is moving to\r
- * @param {Number} index The index it is being moved to\r
- */\r
- 'beforemovenode',\r
- /**\r
- * @event beforeinsert\r
- * Fires before a new child is inserted in a node in this tree, return false to cancel the insert.\r
- * @param {Tree} tree The owner tree\r
- * @param {Node} parent The parent node\r
- * @param {Node} node The child node to be inserted\r
- * @param {Node} refNode The child node the node is being inserted before\r
- */\r
- 'beforeinsert',\r
-\r
- /**\r
- * @event beforeload\r
- * Fires before a node is loaded, return false to cancel\r
- * @param {Node} node The node being loaded\r
- */\r
- 'beforeload',\r
- /**\r
- * @event load\r
- * Fires when a node is loaded\r
- * @param {Node} node The node that was loaded\r
- */\r
- 'load',\r
- /**\r
- * @event textchange\r
- * Fires when the text for a node is changed\r
- * @param {Node} node The node\r
- * @param {String} text The new text\r
- * @param {String} oldText The old text\r
- */\r
- 'textchange',\r
- /**\r
- * @event beforeexpandnode\r
- * Fires before a node is expanded, return false to cancel.\r
- * @param {Node} node The node\r
- * @param {Boolean} deep\r
- * @param {Boolean} anim\r
- */\r
- 'beforeexpandnode',\r
- /**\r
- * @event beforecollapsenode\r
- * Fires before a node is collapsed, return false to cancel.\r
- * @param {Node} node The node\r
- * @param {Boolean} deep\r
- * @param {Boolean} anim\r
- */\r
- 'beforecollapsenode',\r
- /**\r
- * @event expandnode\r
- * Fires when a node is expanded\r
- * @param {Node} node The node\r
- */\r
- 'expandnode',\r
- /**\r
- * @event disabledchange\r
- * Fires when the disabled status of a node changes\r
- * @param {Node} node The node\r
- * @param {Boolean} disabled\r
- */\r
- 'disabledchange',\r
- /**\r
- * @event collapsenode\r
- * Fires when a node is collapsed\r
- * @param {Node} node The node\r
- */\r
- 'collapsenode',\r
- /**\r
- * @event beforeclick\r
- * Fires before click processing on a node. Return false to cancel the default action.\r
- * @param {Node} node The node\r
- * @param {Ext.EventObject} e The event object\r
- */\r
- 'beforeclick',\r
- /**\r
- * @event click\r
- * Fires when a node is clicked\r
- * @param {Node} node The node\r
- * @param {Ext.EventObject} e The event object\r
- */\r
- 'click',\r
- /**\r
- * @event containerclick\r
- * Fires when the tree container is clicked\r
- * @param {Tree} this\r
- * @param {Ext.EventObject} e The event object\r
- */\r
- 'containerclick',\r
- /**\r
- * @event checkchange\r
- * Fires when a node with a checkbox's checked property changes\r
- * @param {Node} this This node\r
- * @param {Boolean} checked\r
- */\r
- 'checkchange',\r
- /**\r
- * @event beforedblclick\r
- * Fires before double click processing on a node. Return false to cancel the default action.\r
- * @param {Node} node The node\r
- * @param {Ext.EventObject} e The event object\r
- */\r
- 'beforedblclick',\r
- /**\r
- * @event dblclick\r
- * Fires when a node is double clicked\r
- * @param {Node} node The node\r
- * @param {Ext.EventObject} e The event object\r
- */\r
- 'dblclick',\r
- /**\r
- * @event containerdblclick\r
- * Fires when the tree container is double clicked\r
- * @param {Tree} this\r
- * @param {Ext.EventObject} e The event object\r
- */\r
- 'containerdblclick',\r
- /**\r
- * @event contextmenu\r
- * Fires when a node is right clicked. To display a context menu in response to this\r
- * event, first create a Menu object (see {@link Ext.menu.Menu} for details), then add\r
- * a handler for this event:<pre><code>\r
-new Ext.tree.TreePanel({\r
- title: 'My TreePanel',\r
- root: new Ext.tree.AsyncTreeNode({\r
- text: 'The Root',\r
- children: [\r
- { text: 'Child node 1', leaf: true },\r
- { text: 'Child node 2', leaf: true }\r
- ]\r
- }),\r
- contextMenu: new Ext.menu.Menu({\r
- items: [{\r
- id: 'delete-node',\r
- text: 'Delete Node'\r
- }],\r
- listeners: {\r
- itemclick: function(item) {\r
- switch (item.id) {\r
- case 'delete-node':\r
- var n = item.parentMenu.contextNode;\r
- if (n.parentNode) {\r
- n.remove();\r
- }\r
- break;\r
- }\r
- }\r
- }\r
- }),\r
- listeners: {\r
- contextmenu: function(node, e) {\r
-// Register the context node with the menu so that a Menu Item's handler function can access\r
-// it via its {@link Ext.menu.BaseItem#parentMenu parentMenu} property.\r
- node.select();\r
- var c = node.getOwnerTree().contextMenu;\r
- c.contextNode = node;\r
- c.showAt(e.getXY());\r
- }\r
- }\r
-});\r
-</code></pre>\r
- * @param {Node} node The node\r
- * @param {Ext.EventObject} e The event object\r
- */\r
- 'contextmenu',\r
- /**\r
- * @event containercontextmenu\r
- * Fires when the tree container is right clicked\r
- * @param {Tree} this\r
- * @param {Ext.EventObject} e The event object\r
- */\r
- 'containercontextmenu',\r
- /**\r
- * @event beforechildrenrendered\r
- * Fires right before the child nodes for a node are rendered\r
- * @param {Node} node The node\r
- */\r
- 'beforechildrenrendered',\r
- /**\r
- * @event startdrag\r
- * Fires when a node starts being dragged\r
- * @param {Ext.tree.TreePanel} this\r
- * @param {Ext.tree.TreeNode} node\r
- * @param {event} e The raw browser event\r
- */\r
- 'startdrag',\r
- /**\r
- * @event enddrag\r
- * Fires when a drag operation is complete\r
- * @param {Ext.tree.TreePanel} this\r
- * @param {Ext.tree.TreeNode} node\r
- * @param {event} e The raw browser event\r
- */\r
- 'enddrag',\r
- /**\r
- * @event dragdrop\r
- * Fires when a dragged node is dropped on a valid DD target\r
- * @param {Ext.tree.TreePanel} this\r
- * @param {Ext.tree.TreeNode} node\r
- * @param {DD} dd The dd it was dropped on\r
- * @param {event} e The raw browser event\r
- */\r
- 'dragdrop',\r
- /**\r
- * @event beforenodedrop\r
- * Fires when a DD object is dropped on a node in this tree for preprocessing. Return false to cancel the drop. The dropEvent\r
- * passed to handlers has the following properties:<br />\r
- * <ul style="padding:5px;padding-left:16px;">\r
- * <li>tree - The TreePanel</li>\r
- * <li>target - The node being targeted for the drop</li>\r
- * <li>data - The drag data from the drag source</li>\r
- * <li>point - The point of the drop - append, above or below</li>\r
- * <li>source - The drag source</li>\r
- * <li>rawEvent - Raw mouse event</li>\r
- * <li>dropNode - Drop node(s) provided by the source <b>OR</b> you can supply node(s)\r
- * to be inserted by setting them on this object.</li>\r
- * <li>cancel - Set this to true to cancel the drop.</li>\r
- * <li>dropStatus - If the default drop action is cancelled but the drop is valid, setting this to true\r
- * will prevent the animated 'repair' from appearing.</li>\r
- * </ul>\r
- * @param {Object} dropEvent\r
- */\r
- 'beforenodedrop',\r
- /**\r
- * @event nodedrop\r
- * Fires after a DD object is dropped on a node in this tree. The dropEvent\r
- * passed to handlers has the following properties:<br />\r
- * <ul style="padding:5px;padding-left:16px;">\r
- * <li>tree - The TreePanel</li>\r
- * <li>target - The node being targeted for the drop</li>\r
- * <li>data - The drag data from the drag source</li>\r
- * <li>point - The point of the drop - append, above or below</li>\r
- * <li>source - The drag source</li>\r
- * <li>rawEvent - Raw mouse event</li>\r
- * <li>dropNode - Dropped node(s).</li>\r
- * </ul>\r
- * @param {Object} dropEvent\r
- */\r
- 'nodedrop',\r
- /**\r
- * @event nodedragover\r
- * Fires when a tree node is being targeted for a drag drop, return false to signal drop not allowed. The dragOverEvent\r
- * passed to handlers has the following properties:<br />\r
- * <ul style="padding:5px;padding-left:16px;">\r
- * <li>tree - The TreePanel</li>\r
- * <li>target - The node being targeted for the drop</li>\r
- * <li>data - The drag data from the drag source</li>\r
- * <li>point - The point of the drop - append, above or below</li>\r
- * <li>source - The drag source</li>\r
- * <li>rawEvent - Raw mouse event</li>\r
- * <li>dropNode - Drop node(s) provided by the source.</li>\r
- * <li>cancel - Set this to true to signal drop not allowed.</li>\r
- * </ul>\r
- * @param {Object} dragOverEvent\r
- */\r
- 'nodedragover'\r
- );\r
- if(this.singleExpand){\r
- this.on('beforeexpandnode', this.restrictExpand, this);\r
- }\r
- },\r
-\r
- // private\r
- proxyNodeEvent : function(ename, a1, a2, a3, a4, a5, a6){\r
- if(ename == 'collapse' || ename == 'expand' || ename == 'beforecollapse' || ename == 'beforeexpand' || ename == 'move' || ename == 'beforemove'){\r
- ename = ename+'node';\r
- }\r
- // args inline for performance while bubbling events\r
- return this.fireEvent(ename, a1, a2, a3, a4, a5, a6);\r
- },\r
-\r
-\r
- /**\r
- * Returns this root node for this tree\r
- * @return {Node}\r
- */\r
- getRootNode : function(){\r
- return this.root;\r
- },\r
-\r
- /**\r
- * Sets the root node for this tree. If the TreePanel has already rendered a root node, the\r
- * previous root node (and all of its descendants) are destroyed before the new root node is rendered.\r
- * @param {Node} node\r
- * @return {Node}\r
- */\r
- setRootNode : function(node){\r
- Ext.destroy(this.root);\r
- if(!node.render){ // attributes passed\r
- node = this.loader.createNode(node);\r
- }\r
- this.root = node;\r
- node.ownerTree = this;\r
- node.isRoot = true;\r
- this.registerNode(node);\r
- if(!this.rootVisible){\r
- var uiP = node.attributes.uiProvider;\r
- node.ui = uiP ? new uiP(node) : new Ext.tree.RootTreeNodeUI(node);\r
- }\r
- if(this.innerCt){\r
- this.clearInnerCt();\r
- this.renderRoot();\r
- }\r
- return node;\r
- },\r
- \r
- clearInnerCt : function(){\r
- this.innerCt.update(''); \r
- },\r
- \r
- // private\r
- renderRoot : function(){\r
- this.root.render();\r
- if(!this.rootVisible){\r
- this.root.renderChildren();\r
- }\r
- },\r
-\r
- /**\r
- * Gets a node in this tree by its id\r
- * @param {String} id\r
- * @return {Node}\r
- */\r
- getNodeById : function(id){\r
- return this.nodeHash[id];\r
- },\r
-\r
- // private\r
- registerNode : function(node){\r
- this.nodeHash[node.id] = node;\r
- },\r
-\r
- // private\r
- unregisterNode : function(node){\r
- delete this.nodeHash[node.id];\r
- },\r
-\r
- // private\r
- toString : function(){\r
- return '[Tree'+(this.id?' '+this.id:'')+']';\r
- },\r
-\r
- // private\r
- restrictExpand : function(node){\r
- var p = node.parentNode;\r
- if(p){\r
- if(p.expandedChild && p.expandedChild.parentNode == p){\r
- p.expandedChild.collapse();\r
- }\r
- p.expandedChild = node;\r
- }\r
- },\r
-\r
- /**\r
- * Retrieve an array of checked nodes, or an array of a specific attribute of checked nodes (e.g. 'id')\r
- * @param {String} attribute (optional) Defaults to null (return the actual nodes)\r
- * @param {TreeNode} startNode (optional) The node to start from, defaults to the root\r
- * @return {Array}\r
- */\r
- getChecked : function(a, startNode){\r
- startNode = startNode || this.root;\r
- var r = [];\r
- var f = function(){\r
- if(this.attributes.checked){\r
- r.push(!a ? this : (a == 'id' ? this.id : this.attributes[a]));\r
- }\r
- };\r
- startNode.cascade(f);\r
- return r;\r
- },\r
-\r
- /**\r
- * Returns the default {@link Ext.tree.TreeLoader} for this TreePanel.\r
- * @return {Ext.tree.TreeLoader} The TreeLoader for this TreePanel.\r
- */\r
- getLoader : function(){\r
- return this.loader;\r
- },\r
-\r
- /**\r
- * Expand all nodes\r
- */\r
- expandAll : function(){\r
- this.root.expand(true);\r
- },\r
-\r
- /**\r
- * Collapse all nodes\r
- */\r
- collapseAll : function(){\r
- this.root.collapse(true);\r
- },\r
-\r
- /**\r
- * Returns the selection model used by this TreePanel.\r
- * @return {TreeSelectionModel} The selection model used by this TreePanel\r
- */\r
- getSelectionModel : function(){\r
- if(!this.selModel){\r
- this.selModel = new Ext.tree.DefaultSelectionModel();\r
- }\r
- return this.selModel;\r
- },\r
-\r
- /**\r
- * Expands a specified path in this TreePanel. A path can be retrieved from a node with {@link Ext.data.Node#getPath}\r
- * @param {String} path\r
- * @param {String} attr (optional) The attribute used in the path (see {@link Ext.data.Node#getPath} for more info)\r
- * @param {Function} callback (optional) The callback to call when the expand is complete. The callback will be called with\r
- * (bSuccess, oLastNode) where bSuccess is if the expand was successful and oLastNode is the last node that was expanded.\r
- */\r
- expandPath : function(path, attr, callback){\r
- attr = attr || 'id';\r
- var keys = path.split(this.pathSeparator);\r
- var curNode = this.root;\r
- if(curNode.attributes[attr] != keys[1]){ // invalid root\r
- if(callback){\r
- callback(false, null);\r
- }\r
- return;\r
- }\r
- var index = 1;\r
- var f = function(){\r
- if(++index == keys.length){\r
- if(callback){\r
- callback(true, curNode);\r
- }\r
- return;\r
- }\r
- var c = curNode.findChild(attr, keys[index]);\r
- if(!c){\r
- if(callback){\r
- callback(false, curNode);\r
- }\r
- return;\r
- }\r
- curNode = c;\r
- c.expand(false, false, f);\r
- };\r
- curNode.expand(false, false, f);\r
- },\r
-\r
- /**\r
- * Selects the node in this tree at the specified path. A path can be retrieved from a node with {@link Ext.data.Node#getPath}\r
- * @param {String} path\r
- * @param {String} attr (optional) The attribute used in the path (see {@link Ext.data.Node#getPath} for more info)\r
- * @param {Function} callback (optional) The callback to call when the selection is complete. The callback will be called with\r
- * (bSuccess, oSelNode) where bSuccess is if the selection was successful and oSelNode is the selected node.\r
- */\r
- selectPath : function(path, attr, callback){\r
- attr = attr || 'id';\r
- var keys = path.split(this.pathSeparator),\r
- v = keys.pop();\r
- if(keys.length > 1){\r
- var f = function(success, node){\r
- if(success && node){\r
- var n = node.findChild(attr, v);\r
- if(n){\r
- n.select();\r
- if(callback){\r
- callback(true, n);\r
- }\r
- }else if(callback){\r
- callback(false, n);\r
- }\r
- }else{\r
- if(callback){\r
- callback(false, n);\r
- }\r
- }\r
- };\r
- this.expandPath(keys.join(this.pathSeparator), attr, f);\r
- }else{\r
- this.root.select();\r
- if(callback){\r
- callback(true, this.root);\r
- }\r
- }\r
- },\r
-\r
- /**\r
- * Returns the underlying Element for this tree\r
- * @return {Ext.Element} The Element\r
- */\r
- getTreeEl : function(){\r
- return this.body;\r
- },\r
-\r
- // private\r
- onRender : function(ct, position){\r
- Ext.tree.TreePanel.superclass.onRender.call(this, ct, position);\r
- this.el.addClass('x-tree');\r
- this.innerCt = this.body.createChild({tag:'ul',\r
- cls:'x-tree-root-ct ' +\r
- (this.useArrows ? 'x-tree-arrows' : this.lines ? 'x-tree-lines' : 'x-tree-no-lines')});\r
- },\r
-\r
- // private\r
- initEvents : function(){\r
- Ext.tree.TreePanel.superclass.initEvents.call(this);\r
-\r
- if(this.containerScroll){\r
- Ext.dd.ScrollManager.register(this.body);\r
- }\r
- if((this.enableDD || this.enableDrop) && !this.dropZone){\r
- /**\r
- * The dropZone used by this tree if drop is enabled (see {@link #enableDD} or {@link #enableDrop})\r
- * @property dropZone\r
- * @type Ext.tree.TreeDropZone\r
- */\r
- this.dropZone = new Ext.tree.TreeDropZone(this, this.dropConfig || {\r
- ddGroup: this.ddGroup || 'TreeDD', appendOnly: this.ddAppendOnly === true\r
- });\r
- }\r
- if((this.enableDD || this.enableDrag) && !this.dragZone){\r
- /**\r
- * The dragZone used by this tree if drag is enabled (see {@link #enableDD} or {@link #enableDrag})\r
- * @property dragZone\r
- * @type Ext.tree.TreeDragZone\r
- */\r
- this.dragZone = new Ext.tree.TreeDragZone(this, this.dragConfig || {\r
- ddGroup: this.ddGroup || 'TreeDD',\r
- scroll: this.ddScroll\r
- });\r
- }\r
- this.getSelectionModel().init(this);\r
- },\r
-\r
- // private\r
- afterRender : function(){\r
- Ext.tree.TreePanel.superclass.afterRender.call(this);\r
- this.renderRoot();\r
- },\r
-\r
- beforeDestroy : function(){\r
- if(this.rendered){\r
- Ext.dd.ScrollManager.unregister(this.body);\r
- Ext.destroy(this.dropZone, this.dragZone);\r
- }\r
- Ext.destroy(this.root, this.loader);\r
- this.nodeHash = this.root = this.loader = null;\r
- Ext.tree.TreePanel.superclass.beforeDestroy.call(this);\r
- }\r
-\r
- /**\r
- * @cfg {String/Number} activeItem\r
- * @hide\r
- */\r
- /**\r
- * @cfg {Boolean} autoDestroy\r
- * @hide\r
- */\r
- /**\r
- * @cfg {Object/String/Function} autoLoad\r
- * @hide\r
- */\r
- /**\r
- * @cfg {Boolean} autoWidth\r
- * @hide\r
- */\r
- /**\r
- * @cfg {Boolean/Number} bufferResize\r
- * @hide\r
- */\r
- /**\r
- * @cfg {String} defaultType\r
- * @hide\r
- */\r
- /**\r
- * @cfg {Object} defaults\r
- * @hide\r
- */\r
- /**\r
- * @cfg {Boolean} hideBorders\r
- * @hide\r
- */\r
- /**\r
- * @cfg {Mixed} items\r
- * @hide\r
- */\r
- /**\r
- * @cfg {String} layout\r
- * @hide\r
- */\r
- /**\r
- * @cfg {Object} layoutConfig\r
- * @hide\r
- */\r
- /**\r
- * @cfg {Boolean} monitorResize\r
- * @hide\r
- */\r
- /**\r
- * @property items\r
- * @hide\r
- */\r
- /**\r
- * @method cascade\r
- * @hide\r
- */\r
- /**\r
- * @method doLayout\r
- * @hide\r
- */\r
- /**\r
- * @method find\r
- * @hide\r
- */\r
- /**\r
- * @method findBy\r
- * @hide\r
- */\r
- /**\r
- * @method findById\r
- * @hide\r
- */\r
- /**\r
- * @method findByType\r
- * @hide\r
- */\r
- /**\r
- * @method getComponent\r
- * @hide\r
- */\r
- /**\r
- * @method getLayout\r
- * @hide\r
- */\r
- /**\r
- * @method getUpdater\r
- * @hide\r
- */\r
- /**\r
- * @method insert\r
- * @hide\r
- */\r
- /**\r
- * @method load\r
- * @hide\r
- */\r
- /**\r
- * @method remove\r
- * @hide\r
- */\r
- /**\r
- * @event add\r
- * @hide\r
- */\r
- /**\r
- * @method removeAll\r
- * @hide\r
- */\r
- /**\r
- * @event afterLayout\r
- * @hide\r
- */\r
- /**\r
- * @event beforeadd\r
- * @hide\r
- */\r
- /**\r
- * @event beforeremove\r
- * @hide\r
- */\r
- /**\r
- * @event remove\r
- * @hide\r
- */\r
-\r
-\r
-\r
- /**\r
- * @cfg {String} allowDomMove @hide\r
- */\r
- /**\r
- * @cfg {String} autoEl @hide\r
- */\r
- /**\r
- * @cfg {String} applyTo @hide\r
- */\r
- /**\r
- * @cfg {String} contentEl @hide\r
- */\r
- /**\r
- * @cfg {Mixed} data @hide\r
- */\r
- /**\r
- * @cfg {Mixed} tpl @hide\r
- */\r
- /**\r
- * @cfg {String} tplWriteMode @hide\r
- */\r
- /**\r
- * @cfg {String} disabledClass @hide\r
- */\r
- /**\r
- * @cfg {String} elements @hide\r
- */\r
- /**\r
- * @cfg {String} html @hide\r
- */\r
- /**\r
- * @cfg {Boolean} preventBodyReset\r
- * @hide\r
- */\r
- /**\r
- * @property disabled\r
- * @hide\r
- */\r
- /**\r
- * @method applyToMarkup\r
- * @hide\r
- */\r
- /**\r
- * @method enable\r
- * @hide\r
- */\r
- /**\r
- * @method disable\r
- * @hide\r
- */\r
- /**\r
- * @method setDisabled\r
- * @hide\r
- */\r
-});\r
-\r
-Ext.tree.TreePanel.nodeTypes = {};\r
-\r
-Ext.reg('treepanel', Ext.tree.TreePanel);Ext.tree.TreeEventModel = function(tree){\r
- this.tree = tree;\r
- this.tree.on('render', this.initEvents, this);\r
-}\r
-\r
-Ext.tree.TreeEventModel.prototype = {\r
- initEvents : function(){\r
- var t = this.tree;\r
-\r
- if(t.trackMouseOver !== false){\r
- t.mon(t.innerCt, {\r
- scope: this,\r
- mouseover: this.delegateOver,\r
- mouseout: this.delegateOut\r
- });\r
- }\r
- t.mon(t.getTreeEl(), {\r
- scope: this,\r
- click: this.delegateClick,\r
- dblclick: this.delegateDblClick,\r
- contextmenu: this.delegateContextMenu\r
- });\r
- },\r
-\r
- getNode : function(e){\r
- var t;\r
- if(t = e.getTarget('.x-tree-node-el', 10)){\r
- var id = Ext.fly(t, '_treeEvents').getAttribute('tree-node-id', 'ext');\r
- if(id){\r
- return this.tree.getNodeById(id);\r
- }\r
- }\r
- return null;\r
- },\r
-\r
- getNodeTarget : function(e){\r
- var t = e.getTarget('.x-tree-node-icon', 1);\r
- if(!t){\r
- t = e.getTarget('.x-tree-node-el', 6);\r
- }\r
- return t;\r
- },\r
-\r
- delegateOut : function(e, t){\r
- if(!this.beforeEvent(e)){\r
- return;\r
- }\r
- if(e.getTarget('.x-tree-ec-icon', 1)){\r
- var n = this.getNode(e);\r
- this.onIconOut(e, n);\r
- if(n == this.lastEcOver){\r
- delete this.lastEcOver;\r
- }\r
- }\r
- if((t = this.getNodeTarget(e)) && !e.within(t, true)){\r
- this.onNodeOut(e, this.getNode(e));\r
- }\r
- },\r
-\r
- delegateOver : function(e, t){\r
- if(!this.beforeEvent(e)){\r
- return;\r
- }\r
- if(Ext.isGecko && !this.trackingDoc){ // prevent hanging in FF\r
- Ext.getBody().on('mouseover', this.trackExit, this);\r
- this.trackingDoc = true;\r
- }\r
- if(this.lastEcOver){ // prevent hung highlight\r
- this.onIconOut(e, this.lastEcOver);\r
- delete this.lastEcOver;\r
- }\r
- if(e.getTarget('.x-tree-ec-icon', 1)){\r
- this.lastEcOver = this.getNode(e);\r
- this.onIconOver(e, this.lastEcOver);\r
- }\r
- if(t = this.getNodeTarget(e)){\r
- this.onNodeOver(e, this.getNode(e));\r
- }\r
- },\r
-\r
- trackExit : function(e){\r
- if(this.lastOverNode){\r
- if(this.lastOverNode.ui && !e.within(this.lastOverNode.ui.getEl())){\r
- this.onNodeOut(e, this.lastOverNode);\r
- }\r
- delete this.lastOverNode;\r
- Ext.getBody().un('mouseover', this.trackExit, this);\r
- this.trackingDoc = false;\r
- }\r
-\r
- },\r
-\r
- delegateClick : function(e, t){\r
- if(this.beforeEvent(e)){\r
- if(e.getTarget('input[type=checkbox]', 1)){\r
- this.onCheckboxClick(e, this.getNode(e));\r
- }else if(e.getTarget('.x-tree-ec-icon', 1)){\r
- this.onIconClick(e, this.getNode(e));\r
- }else if(this.getNodeTarget(e)){\r
- this.onNodeClick(e, this.getNode(e));\r
- }else{\r
- this.onContainerEvent(e, 'click');\r
- }\r
- }\r
- },\r
-\r
- delegateDblClick : function(e, t){\r
- if(this.beforeEvent(e)){\r
- if(this.getNodeTarget(e)){\r
- this.onNodeDblClick(e, this.getNode(e));\r
- }else{\r
- this.onContainerEvent(e, 'dblclick');\r
- }\r
- }\r
- },\r
-\r
- delegateContextMenu : function(e, t){\r
- if(this.beforeEvent(e)){\r
- if(this.getNodeTarget(e)){\r
- this.onNodeContextMenu(e, this.getNode(e));\r
- }else{\r
- this.onContainerEvent(e, 'contextmenu');\r
- }\r
- }\r
- },\r
-\r
- onContainerEvent: function(e, type){\r
- this.tree.fireEvent('container' + type, this.tree, e);\r
- },\r
-\r
- onNodeClick : function(e, node){\r
- node.ui.onClick(e);\r
- },\r
-\r
- onNodeOver : function(e, node){\r
- this.lastOverNode = node;\r
- node.ui.onOver(e);\r
- },\r
-\r
- onNodeOut : function(e, node){\r
- node.ui.onOut(e);\r
- },\r
-\r
- onIconOver : function(e, node){\r
- node.ui.addClass('x-tree-ec-over');\r
- },\r
-\r
- onIconOut : function(e, node){\r
- node.ui.removeClass('x-tree-ec-over');\r
- },\r
-\r
- onIconClick : function(e, node){\r
- node.ui.ecClick(e);\r
- },\r
-\r
- onCheckboxClick : function(e, node){\r
- node.ui.onCheckChange(e);\r
- },\r
-\r
- onNodeDblClick : function(e, node){\r
- node.ui.onDblClick(e);\r
- },\r
-\r
- onNodeContextMenu : function(e, node){\r
- node.ui.onContextMenu(e);\r
- },\r
-\r
- beforeEvent : function(e){\r
- var node = this.getNode(e);\r
- if(this.disabled || !node || !node.ui){\r
- e.stopEvent();\r
- return false;\r
- }\r
- return true;\r
- },\r
-\r
- disable: function(){\r
- this.disabled = true;\r
- },\r
-\r
- enable: function(){\r
- this.disabled = false;\r
- }\r
-};/**\r
- * @class Ext.tree.DefaultSelectionModel\r
- * @extends Ext.util.Observable\r
- * The default single selection for a TreePanel.\r
- */\r
-Ext.tree.DefaultSelectionModel = function(config){\r
- this.selNode = null;\r
- \r
- this.addEvents(\r
- /**\r
- * @event selectionchange\r
- * Fires when the selected node changes\r
- * @param {DefaultSelectionModel} this\r
- * @param {TreeNode} node the new selection\r
- */\r
- 'selectionchange',\r
-\r
- /**\r
- * @event beforeselect\r
- * Fires before the selected node changes, return false to cancel the change\r
- * @param {DefaultSelectionModel} this\r
- * @param {TreeNode} node the new selection\r
- * @param {TreeNode} node the old selection\r
- */\r
- 'beforeselect'\r
- );\r
-\r
- Ext.apply(this, config);\r
- Ext.tree.DefaultSelectionModel.superclass.constructor.call(this);\r
-};\r
-\r
-Ext.extend(Ext.tree.DefaultSelectionModel, Ext.util.Observable, {\r
- init : function(tree){\r
- this.tree = tree;\r
- tree.mon(tree.getTreeEl(), 'keydown', this.onKeyDown, this);\r
- tree.on('click', this.onNodeClick, this);\r
- },\r
- \r
- onNodeClick : function(node, e){\r
- this.select(node);\r
- },\r
- \r
- /**\r
- * Select a node.\r
- * @param {TreeNode} node The node to select\r
- * @return {TreeNode} The selected node\r
- */\r
- select : function(node, /* private*/ selectNextNode){\r
- // If node is hidden, select the next node in whatever direction was being moved in.\r
- if (!Ext.fly(node.ui.wrap).isVisible() && selectNextNode) {\r
- return selectNextNode.call(this, node);\r
- }\r
- var last = this.selNode;\r
- if(node == last){\r
- node.ui.onSelectedChange(true);\r
- }else if(this.fireEvent('beforeselect', this, node, last) !== false){\r
- if(last && last.ui){\r
- last.ui.onSelectedChange(false);\r
- }\r
- this.selNode = node;\r
- node.ui.onSelectedChange(true);\r
- this.fireEvent('selectionchange', this, node, last);\r
- }\r
- return node;\r
- },\r
- \r
- /**\r
- * Deselect a node.\r
- * @param {TreeNode} node The node to unselect\r
- * @param {Boolean} silent True to stop the selectionchange event from firing.\r
- */\r
- unselect : function(node, silent){\r
- if(this.selNode == node){\r
- this.clearSelections(silent);\r
- } \r
- },\r
- \r
- /**\r
- * Clear all selections\r
- * @param {Boolean} silent True to stop the selectionchange event from firing.\r
- */\r
- clearSelections : function(silent){\r
- var n = this.selNode;\r
- if(n){\r
- n.ui.onSelectedChange(false);\r
- this.selNode = null;\r
- if(silent !== true){\r
- this.fireEvent('selectionchange', this, null);\r
- }\r
- }\r
- return n;\r
- },\r
- \r
- /**\r
- * Get the selected node\r
- * @return {TreeNode} The selected node\r
- */\r
- getSelectedNode : function(){\r
- return this.selNode; \r
- },\r
- \r
- /**\r
- * Returns true if the node is selected\r
- * @param {TreeNode} node The node to check\r
- * @return {Boolean}\r
- */\r
- isSelected : function(node){\r
- return this.selNode == node; \r
- },\r
-\r
- /**\r
- * Selects the node above the selected node in the tree, intelligently walking the nodes\r
- * @return TreeNode The new selection\r
- */\r
- selectPrevious : function(/* private */ s){\r
- if(!(s = s || this.selNode || this.lastSelNode)){\r
- return null;\r
- }\r
- // Here we pass in the current function to select to indicate the direction we're moving\r
- var ps = s.previousSibling;\r
- if(ps){\r
- if(!ps.isExpanded() || ps.childNodes.length < 1){\r
- return this.select(ps, this.selectPrevious);\r
- } else{\r
- var lc = ps.lastChild;\r
- while(lc && lc.isExpanded() && Ext.fly(lc.ui.wrap).isVisible() && lc.childNodes.length > 0){\r
- lc = lc.lastChild;\r
- }\r
- return this.select(lc, this.selectPrevious);\r
- }\r
- } else if(s.parentNode && (this.tree.rootVisible || !s.parentNode.isRoot)){\r
- return this.select(s.parentNode, this.selectPrevious);\r
- }\r
- return null;\r
- },\r
-\r
- /**\r
- * Selects the node above the selected node in the tree, intelligently walking the nodes\r
- * @return TreeNode The new selection\r
- */\r
- selectNext : function(/* private */ s){\r
- if(!(s = s || this.selNode || this.lastSelNode)){\r
- return null;\r
- }\r
- // Here we pass in the current function to select to indicate the direction we're moving\r
- if(s.firstChild && s.isExpanded() && Ext.fly(s.ui.wrap).isVisible()){\r
- return this.select(s.firstChild, this.selectNext);\r
- }else if(s.nextSibling){\r
- return this.select(s.nextSibling, this.selectNext);\r
- }else if(s.parentNode){\r
- var newS = null;\r
- s.parentNode.bubble(function(){\r
- if(this.nextSibling){\r
- newS = this.getOwnerTree().selModel.select(this.nextSibling, this.selectNext);\r
- return false;\r
- }\r
- });\r
- return newS;\r
- }\r
- return null;\r
- },\r
-\r
- onKeyDown : function(e){\r
- var s = this.selNode || this.lastSelNode;\r
- // undesirable, but required\r
- var sm = this;\r
- if(!s){\r
- return;\r
- }\r
- var k = e.getKey();\r
- switch(k){\r
- case e.DOWN:\r
- e.stopEvent();\r
- this.selectNext();\r
- break;\r
- case e.UP:\r
- e.stopEvent();\r
- this.selectPrevious();\r
- break;\r
- case e.RIGHT:\r
- e.preventDefault();\r
- if(s.hasChildNodes()){\r
- if(!s.isExpanded()){\r
- s.expand();\r
- }else if(s.firstChild){\r
- this.select(s.firstChild, e);\r
- }\r
- }\r
- break;\r
- case e.LEFT:\r
- e.preventDefault();\r
- if(s.hasChildNodes() && s.isExpanded()){\r
- s.collapse();\r
- }else if(s.parentNode && (this.tree.rootVisible || s.parentNode != this.tree.getRootNode())){\r
- this.select(s.parentNode, e);\r
- }\r
- break;\r
- };\r
- }\r
-});\r
-\r
-/**\r
- * @class Ext.tree.MultiSelectionModel\r
- * @extends Ext.util.Observable\r
- * Multi selection for a TreePanel.\r
- */\r
-Ext.tree.MultiSelectionModel = function(config){\r
- this.selNodes = [];\r
- this.selMap = {};\r
- this.addEvents(\r
- /**\r
- * @event selectionchange\r
- * Fires when the selected nodes change\r
- * @param {MultiSelectionModel} this\r
- * @param {Array} nodes Array of the selected nodes\r
- */\r
- 'selectionchange'\r
- );\r
- Ext.apply(this, config);\r
- Ext.tree.MultiSelectionModel.superclass.constructor.call(this);\r
-};\r
-\r
-Ext.extend(Ext.tree.MultiSelectionModel, Ext.util.Observable, {\r
- init : function(tree){\r
- this.tree = tree;\r
- tree.mon(tree.getTreeEl(), 'keydown', this.onKeyDown, this);\r
- tree.on('click', this.onNodeClick, this);\r
- },\r
- \r
- onNodeClick : function(node, e){\r
- if(e.ctrlKey && this.isSelected(node)){\r
- this.unselect(node);\r
- }else{\r
- this.select(node, e, e.ctrlKey);\r
- }\r
- },\r
- \r
- /**\r
- * Select a node.\r
- * @param {TreeNode} node The node to select\r
- * @param {EventObject} e (optional) An event associated with the selection\r
- * @param {Boolean} keepExisting True to retain existing selections\r
- * @return {TreeNode} The selected node\r
- */\r
- select : function(node, e, keepExisting){\r
- if(keepExisting !== true){\r
- this.clearSelections(true);\r
- }\r
- if(this.isSelected(node)){\r
- this.lastSelNode = node;\r
- return node;\r
- }\r
- this.selNodes.push(node);\r
- this.selMap[node.id] = node;\r
- this.lastSelNode = node;\r
- node.ui.onSelectedChange(true);\r
- this.fireEvent('selectionchange', this, this.selNodes);\r
- return node;\r
- },\r
- \r
- /**\r
- * Deselect a node.\r
- * @param {TreeNode} node The node to unselect\r
- */\r
- unselect : function(node){\r
- if(this.selMap[node.id]){\r
- node.ui.onSelectedChange(false);\r
- var sn = this.selNodes;\r
- var index = sn.indexOf(node);\r
- if(index != -1){\r
- this.selNodes.splice(index, 1);\r
- }\r
- delete this.selMap[node.id];\r
- this.fireEvent('selectionchange', this, this.selNodes);\r
- }\r
- },\r
- \r
- /**\r
- * Clear all selections\r
- */\r
- clearSelections : function(suppressEvent){\r
- var sn = this.selNodes;\r
- if(sn.length > 0){\r
- for(var i = 0, len = sn.length; i < len; i++){\r
- sn[i].ui.onSelectedChange(false);\r
- }\r
- this.selNodes = [];\r
- this.selMap = {};\r
- if(suppressEvent !== true){\r
- this.fireEvent('selectionchange', this, this.selNodes);\r
- }\r
- }\r
- },\r
- \r
- /**\r
- * Returns true if the node is selected\r
- * @param {TreeNode} node The node to check\r
- * @return {Boolean}\r
- */\r
- isSelected : function(node){\r
- return this.selMap[node.id] ? true : false; \r
- },\r
- \r
- /**\r
- * Returns an array of the selected nodes\r
- * @return {Array}\r
- */\r
- getSelectedNodes : function(){\r
- return this.selNodes; \r
- },\r
-\r
- onKeyDown : Ext.tree.DefaultSelectionModel.prototype.onKeyDown,\r
-\r
- selectNext : Ext.tree.DefaultSelectionModel.prototype.selectNext,\r
-\r
- selectPrevious : Ext.tree.DefaultSelectionModel.prototype.selectPrevious\r
-});/**\r
- * @class Ext.data.Tree\r
- * @extends Ext.util.Observable\r
- * Represents a tree data structure and bubbles all the events for its nodes. The nodes\r
- * in the tree have most standard DOM functionality.\r
- * @constructor\r
- * @param {Node} root (optional) The root node\r
- */\r
-Ext.data.Tree = function(root){\r
- this.nodeHash = {};\r
- /**\r
- * The root node for this tree\r
- * @type Node\r
- */\r
- this.root = null;\r
- if(root){\r
- this.setRootNode(root);\r
- }\r
- this.addEvents(\r
- /**\r
- * @event append\r
- * Fires when a new child node is appended to a node in this tree.\r
- * @param {Tree} tree The owner tree\r
- * @param {Node} parent The parent node\r
- * @param {Node} node The newly appended node\r
- * @param {Number} index The index of the newly appended node\r
- */\r
- "append",\r
- /**\r
- * @event remove\r
- * Fires when a child node is removed from a node in this tree.\r
- * @param {Tree} tree The owner tree\r
- * @param {Node} parent The parent node\r
- * @param {Node} node The child node removed\r
- */\r
- "remove",\r
- /**\r
- * @event move\r
- * Fires when a node is moved to a new location in the tree\r
- * @param {Tree} tree The owner tree\r
- * @param {Node} node The node moved\r
- * @param {Node} oldParent The old parent of this node\r
- * @param {Node} newParent The new parent of this node\r
- * @param {Number} index The index it was moved to\r
- */\r
- "move",\r
- /**\r
- * @event insert\r
- * Fires when a new child node is inserted in a node in this tree.\r
- * @param {Tree} tree The owner tree\r
- * @param {Node} parent The parent node\r
- * @param {Node} node The child node inserted\r
- * @param {Node} refNode The child node the node was inserted before\r
- */\r
- "insert",\r
- /**\r
- * @event beforeappend\r
- * Fires before a new child is appended to a node in this tree, return false to cancel the append.\r
- * @param {Tree} tree The owner tree\r
- * @param {Node} parent The parent node\r
- * @param {Node} node The child node to be appended\r
- */\r
- "beforeappend",\r
- /**\r
- * @event beforeremove\r
- * Fires before a child is removed from a node in this tree, return false to cancel the remove.\r
- * @param {Tree} tree The owner tree\r
- * @param {Node} parent The parent node\r
- * @param {Node} node The child node to be removed\r
- */\r
- "beforeremove",\r
- /**\r
- * @event beforemove\r
- * Fires before a node is moved to a new location in the tree. Return false to cancel the move.\r
- * @param {Tree} tree The owner tree\r
- * @param {Node} node The node being moved\r
- * @param {Node} oldParent The parent of the node\r
- * @param {Node} newParent The new parent the node is moving to\r
- * @param {Number} index The index it is being moved to\r
- */\r
- "beforemove",\r
- /**\r
- * @event beforeinsert\r
- * Fires before a new child is inserted in a node in this tree, return false to cancel the insert.\r
- * @param {Tree} tree The owner tree\r
- * @param {Node} parent The parent node\r
- * @param {Node} node The child node to be inserted\r
- * @param {Node} refNode The child node the node is being inserted before\r
- */\r
- "beforeinsert"\r
- );\r
-\r
- Ext.data.Tree.superclass.constructor.call(this);\r
-};\r
-\r
-Ext.extend(Ext.data.Tree, Ext.util.Observable, {\r
- /**\r
- * @cfg {String} pathSeparator\r
- * The token used to separate paths in node ids (defaults to '/').\r
- */\r
- pathSeparator: "/",\r
-\r
- // private\r
- proxyNodeEvent : function(){\r
- return this.fireEvent.apply(this, arguments);\r
- },\r
-\r
- /**\r
- * Returns the root node for this tree.\r
- * @return {Node}\r
- */\r
- getRootNode : function(){\r
- return this.root;\r
- },\r
-\r
- /**\r
- * Sets the root node for this tree.\r
- * @param {Node} node\r
- * @return {Node}\r
- */\r
- setRootNode : function(node){\r
- this.root = node;\r
- node.ownerTree = this;\r
- node.isRoot = true;\r
- this.registerNode(node);\r
- return node;\r
- },\r
-\r
- /**\r
- * Gets a node in this tree by its id.\r
- * @param {String} id\r
- * @return {Node}\r
- */\r
- getNodeById : function(id){\r
- return this.nodeHash[id];\r
- },\r
-\r
- // private\r
- registerNode : function(node){\r
- this.nodeHash[node.id] = node;\r
- },\r
-\r
- // private\r
- unregisterNode : function(node){\r
- delete this.nodeHash[node.id];\r
- },\r
-\r
- toString : function(){\r
- return "[Tree"+(this.id?" "+this.id:"")+"]";\r
- }\r
-});\r
-\r
-/**\r
- * @class Ext.data.Node\r
- * @extends Ext.util.Observable\r
- * @cfg {Boolean} leaf true if this node is a leaf and does not have children\r
- * @cfg {String} id The id for this node. If one is not specified, one is generated.\r
- * @constructor\r
- * @param {Object} attributes The attributes/config for the node\r
- */\r
-Ext.data.Node = function(attributes){\r
- /**\r
- * The attributes supplied for the node. You can use this property to access any custom attributes you supplied.\r
- * @type {Object}\r
- */\r
- this.attributes = attributes || {};\r
- this.leaf = this.attributes.leaf;\r
- /**\r
- * The node id. @type String\r
- */\r
- this.id = this.attributes.id;\r
- if(!this.id){\r
- this.id = Ext.id(null, "xnode-");\r
- this.attributes.id = this.id;\r
- }\r
- /**\r
- * All child nodes of this node. @type Array\r
- */\r
- this.childNodes = [];\r
- if(!this.childNodes.indexOf){ // indexOf is a must\r
- this.childNodes.indexOf = function(o){\r
- for(var i = 0, len = this.length; i < len; i++){\r
- if(this[i] == o){\r
- return i;\r
- }\r
- }\r
- return -1;\r
- };\r
- }\r
- /**\r
- * The parent node for this node. @type Node\r
- */\r
- this.parentNode = null;\r
- /**\r
- * The first direct child node of this node, or null if this node has no child nodes. @type Node\r
- */\r
- this.firstChild = null;\r
- /**\r
- * The last direct child node of this node, or null if this node has no child nodes. @type Node\r
- */\r
- this.lastChild = null;\r
- /**\r
- * The node immediately preceding this node in the tree, or null if there is no sibling node. @type Node\r
- */\r
- this.previousSibling = null;\r
- /**\r
- * The node immediately following this node in the tree, or null if there is no sibling node. @type Node\r
- */\r
- this.nextSibling = null;\r
-\r
- this.addEvents({\r
- /**\r
- * @event append\r
- * Fires when a new child node is appended\r
- * @param {Tree} tree The owner tree\r
- * @param {Node} this This node\r
- * @param {Node} node The newly appended node\r
- * @param {Number} index The index of the newly appended node\r
- */\r
- "append" : true,\r
- /**\r
- * @event remove\r
- * Fires when a child node is removed\r
- * @param {Tree} tree The owner tree\r
- * @param {Node} this This node\r
- * @param {Node} node The removed node\r
- */\r
- "remove" : true,\r
- /**\r
- * @event move\r
- * Fires when this node is moved to a new location in the tree\r
- * @param {Tree} tree The owner tree\r
- * @param {Node} this This node\r
- * @param {Node} oldParent The old parent of this node\r
- * @param {Node} newParent The new parent of this node\r
- * @param {Number} index The index it was moved to\r
- */\r
- "move" : true,\r
- /**\r
- * @event insert\r
- * Fires when a new child node is inserted.\r
- * @param {Tree} tree The owner tree\r
- * @param {Node} this This node\r
- * @param {Node} node The child node inserted\r
- * @param {Node} refNode The child node the node was inserted before\r
- */\r
- "insert" : true,\r
- /**\r
- * @event beforeappend\r
- * Fires before a new child is appended, return false to cancel the append.\r
- * @param {Tree} tree The owner tree\r
- * @param {Node} this This node\r
- * @param {Node} node The child node to be appended\r
- */\r
- "beforeappend" : true,\r
- /**\r
- * @event beforeremove\r
- * Fires before a child is removed, return false to cancel the remove.\r
- * @param {Tree} tree The owner tree\r
- * @param {Node} this This node\r
- * @param {Node} node The child node to be removed\r
- */\r
- "beforeremove" : true,\r
- /**\r
- * @event beforemove\r
- * Fires before this node is moved to a new location in the tree. Return false to cancel the move.\r
- * @param {Tree} tree The owner tree\r
- * @param {Node} this This node\r
- * @param {Node} oldParent The parent of this node\r
- * @param {Node} newParent The new parent this node is moving to\r
- * @param {Number} index The index it is being moved to\r
- */\r
- "beforemove" : true,\r
- /**\r
- * @event beforeinsert\r
- * Fires before a new child is inserted, return false to cancel the insert.\r
- * @param {Tree} tree The owner tree\r
- * @param {Node} this This node\r
- * @param {Node} node The child node to be inserted\r
- * @param {Node} refNode The child node the node is being inserted before\r
- */\r
- "beforeinsert" : true\r
- });\r
- this.listeners = this.attributes.listeners;\r
- Ext.data.Node.superclass.constructor.call(this);\r
-};\r
-\r
-Ext.extend(Ext.data.Node, Ext.util.Observable, {\r
- // private\r
- fireEvent : function(evtName){\r
- // first do standard event for this node\r
- if(Ext.data.Node.superclass.fireEvent.apply(this, arguments) === false){\r
- return false;\r
- }\r
- // then bubble it up to the tree if the event wasn't cancelled\r
- var ot = this.getOwnerTree();\r
- if(ot){\r
- if(ot.proxyNodeEvent.apply(ot, arguments) === false){\r
- return false;\r
- }\r
- }\r
- return true;\r
- },\r
-\r
- /**\r
- * Returns true if this node is a leaf\r
- * @return {Boolean}\r
- */\r
- isLeaf : function(){\r
- return this.leaf === true;\r
- },\r
-\r
- // private\r
- setFirstChild : function(node){\r
- this.firstChild = node;\r
- },\r
-\r
- //private\r
- setLastChild : function(node){\r
- this.lastChild = node;\r
- },\r
-\r
-\r
- /**\r
- * Returns true if this node is the last child of its parent\r
- * @return {Boolean}\r
- */\r
- isLast : function(){\r
- return (!this.parentNode ? true : this.parentNode.lastChild == this);\r
- },\r
-\r
- /**\r
- * Returns true if this node is the first child of its parent\r
- * @return {Boolean}\r
- */\r
- isFirst : function(){\r
- return (!this.parentNode ? true : this.parentNode.firstChild == this);\r
- },\r
-\r
- /**\r
- * Returns true if this node has one or more child nodes, else false.\r
- * @return {Boolean}\r
- */\r
- hasChildNodes : function(){\r
- return !this.isLeaf() && this.childNodes.length > 0;\r
- },\r
- \r
- /**\r
- * Returns true if this node has one or more child nodes, or if the <tt>expandable</tt>\r
- * node attribute is explicitly specified as true (see {@link #attributes}), otherwise returns false.\r
- * @return {Boolean}\r
- */\r
- isExpandable : function(){\r
- return this.attributes.expandable || this.hasChildNodes();\r
- },\r
-\r
- /**\r
- * Insert node(s) as the last child node of this node.\r
- * @param {Node/Array} node The node or Array of nodes to append\r
- * @return {Node} The appended node if single append, or null if an array was passed\r
- */\r
- appendChild : function(node){\r
- var multi = false;\r
- if(Ext.isArray(node)){\r
- multi = node;\r
- }else if(arguments.length > 1){\r
- multi = arguments;\r
- }\r
- // if passed an array or multiple args do them one by one\r
- if(multi){\r
- for(var i = 0, len = multi.length; i < len; i++) {\r
- this.appendChild(multi[i]);\r
- }\r
- }else{\r
- if(this.fireEvent("beforeappend", this.ownerTree, this, node) === false){\r
- return false;\r
- }\r
- var index = this.childNodes.length;\r
- var oldParent = node.parentNode;\r
- // it's a move, make sure we move it cleanly\r
- if(oldParent){\r
- if(node.fireEvent("beforemove", node.getOwnerTree(), node, oldParent, this, index) === false){\r
- return false;\r
- }\r
- oldParent.removeChild(node);\r
- }\r
- index = this.childNodes.length;\r
- if(index === 0){\r
- this.setFirstChild(node);\r
- }\r
- this.childNodes.push(node);\r
- node.parentNode = this;\r
- var ps = this.childNodes[index-1];\r
- if(ps){\r
- node.previousSibling = ps;\r
- ps.nextSibling = node;\r
- }else{\r
- node.previousSibling = null;\r
- }\r
- node.nextSibling = null;\r
- this.setLastChild(node);\r
- node.setOwnerTree(this.getOwnerTree());\r
- this.fireEvent("append", this.ownerTree, this, node, index);\r
- if(oldParent){\r
- node.fireEvent("move", this.ownerTree, node, oldParent, this, index);\r
- }\r
- return node;\r
- }\r
- },\r
-\r
- /**\r
- * Removes a child node from this node.\r
- * @param {Node} node The node to remove\r
- * @param {Boolean} destroy <tt>true</tt> to destroy the node upon removal. Defaults to <tt>false</tt>.\r
- * @return {Node} The removed node\r
- */\r
- removeChild : function(node, destroy){\r
- var index = this.childNodes.indexOf(node);\r
- if(index == -1){\r
- return false;\r
- }\r
- if(this.fireEvent("beforeremove", this.ownerTree, this, node) === false){\r
- return false;\r
- }\r
-\r
- // remove it from childNodes collection\r
- this.childNodes.splice(index, 1);\r
-\r
- // update siblings\r
- if(node.previousSibling){\r
- node.previousSibling.nextSibling = node.nextSibling;\r
- }\r
- if(node.nextSibling){\r
- node.nextSibling.previousSibling = node.previousSibling;\r
- }\r
-\r
- // update child refs\r
- if(this.firstChild == node){\r
- this.setFirstChild(node.nextSibling);\r
- }\r
- if(this.lastChild == node){\r
- this.setLastChild(node.previousSibling);\r
- }\r
-\r
- node.clear();\r
- this.fireEvent("remove", this.ownerTree, this, node);\r
- if(destroy){\r
- node.destroy();\r
- }\r
- return node;\r
- },\r
- \r
- // private\r
- clear : function(destroy){\r
- // clear any references from the node\r
- this.setOwnerTree(null, destroy);\r
- this.parentNode = this.previousSibling = this.nextSibling = null\r
- if(destroy){\r
- this.firstChild = this.lastChild = null; \r
- }\r
- },\r
- \r
- /**\r
- * Destroys the node.\r
- */\r
- destroy : function(){\r
- this.purgeListeners();\r
- this.clear(true); \r
- Ext.each(this.childNodes, function(n){\r
- n.destroy();\r
- });\r
- this.childNodes = null;\r
- },\r
-\r
- /**\r
- * Inserts the first node before the second node in this nodes childNodes collection.\r
- * @param {Node} node The node to insert\r
- * @param {Node} refNode The node to insert before (if null the node is appended)\r
- * @return {Node} The inserted node\r
- */\r
- insertBefore : function(node, refNode){\r
- if(!refNode){ // like standard Dom, refNode can be null for append\r
- return this.appendChild(node);\r
- }\r
- // nothing to do\r
- if(node == refNode){\r
- return false;\r
- }\r
-\r
- if(this.fireEvent("beforeinsert", this.ownerTree, this, node, refNode) === false){\r
- return false;\r
- }\r
- var index = this.childNodes.indexOf(refNode);\r
- var oldParent = node.parentNode;\r
- var refIndex = index;\r
-\r
- // when moving internally, indexes will change after remove\r
- if(oldParent == this && this.childNodes.indexOf(node) < index){\r
- refIndex--;\r
- }\r
-\r
- // it's a move, make sure we move it cleanly\r
- if(oldParent){\r
- if(node.fireEvent("beforemove", node.getOwnerTree(), node, oldParent, this, index, refNode) === false){\r
- return false;\r
- }\r
- oldParent.removeChild(node);\r
- }\r
- if(refIndex === 0){\r
- this.setFirstChild(node);\r
- }\r
- this.childNodes.splice(refIndex, 0, node);\r
- node.parentNode = this;\r
- var ps = this.childNodes[refIndex-1];\r
- if(ps){\r
- node.previousSibling = ps;\r
- ps.nextSibling = node;\r
- }else{\r
- node.previousSibling = null;\r
- }\r
- node.nextSibling = refNode;\r
- refNode.previousSibling = node;\r
- node.setOwnerTree(this.getOwnerTree());\r
- this.fireEvent("insert", this.ownerTree, this, node, refNode);\r
- if(oldParent){\r
- node.fireEvent("move", this.ownerTree, node, oldParent, this, refIndex, refNode);\r
- }\r
- return node;\r
- },\r
-\r
- /**\r
- * Removes this node from its parent\r
- * @param {Boolean} destroy <tt>true</tt> to destroy the node upon removal. Defaults to <tt>false</tt>.\r
- * @return {Node} this\r
- */\r
- remove : function(destroy){\r
- this.parentNode.removeChild(this, destroy);\r
- return this;\r
- },\r
- \r
- /**\r
- * Removes all child nodes from this node.\r
- * @param {Boolean} destroy <tt>true</tt> to destroy the node upon removal. Defaults to <tt>false</tt>.\r
- * @return {Node} this\r
- */\r
- removeAll : function(destroy){\r
- var cn = this.childNodes,\r
- n;\r
- while((n = cn[0])){\r
- this.removeChild(n, destroy);\r
- }\r
- return this;\r
- },\r
-\r
- /**\r
- * Returns the child node at the specified index.\r
- * @param {Number} index\r
- * @return {Node}\r
- */\r
- item : function(index){\r
- return this.childNodes[index];\r
- },\r
-\r
- /**\r
- * Replaces one child node in this node with another.\r
- * @param {Node} newChild The replacement node\r
- * @param {Node} oldChild The node to replace\r
- * @return {Node} The replaced node\r
- */\r
- replaceChild : function(newChild, oldChild){\r
- var s = oldChild ? oldChild.nextSibling : null;\r
- this.removeChild(oldChild);\r
- this.insertBefore(newChild, s);\r
- return oldChild;\r
- },\r
-\r
- /**\r
- * Returns the index of a child node\r
- * @param {Node} node\r
- * @return {Number} The index of the node or -1 if it was not found\r
- */\r
- indexOf : function(child){\r
- return this.childNodes.indexOf(child);\r
- },\r
-\r
- /**\r
- * Returns the tree this node is in.\r
- * @return {Tree}\r
- */\r
- getOwnerTree : function(){\r
- // if it doesn't have one, look for one\r
- if(!this.ownerTree){\r
- var p = this;\r
- while(p){\r
- if(p.ownerTree){\r
- this.ownerTree = p.ownerTree;\r
- break;\r
- }\r
- p = p.parentNode;\r
- }\r
- }\r
- return this.ownerTree;\r
- },\r
-\r
- /**\r
- * Returns depth of this node (the root node has a depth of 0)\r
- * @return {Number}\r
- */\r
- getDepth : function(){\r
- var depth = 0;\r
- var p = this;\r
- while(p.parentNode){\r
- ++depth;\r
- p = p.parentNode;\r
- }\r
- return depth;\r
- },\r
-\r
- // private\r
- setOwnerTree : function(tree, destroy){\r
- // if it is a move, we need to update everyone\r
- if(tree != this.ownerTree){\r
- if(this.ownerTree){\r
- this.ownerTree.unregisterNode(this);\r
- }\r
- this.ownerTree = tree;\r
- // If we're destroying, we don't need to recurse since it will be called on each child node\r
- if(destroy !== true){\r
- Ext.each(this.childNodes, function(n){\r
- n.setOwnerTree(tree);\r
- });\r
- }\r
- if(tree){\r
- tree.registerNode(this);\r
- }\r
- }\r
- },\r
- \r
- /**\r
- * Changes the id of this node.\r
- * @param {String} id The new id for the node.\r
- */\r
- setId: function(id){\r
- if(id !== this.id){\r
- var t = this.ownerTree;\r
- if(t){\r
- t.unregisterNode(this);\r
- }\r
- this.id = this.attributes.id = id;\r
- if(t){\r
- t.registerNode(this);\r
- }\r
- this.onIdChange(id);\r
- }\r
- },\r
- \r
- // private\r
- onIdChange: Ext.emptyFn,\r
-\r
- /**\r
- * Returns the path for this node. The path can be used to expand or select this node programmatically.\r
- * @param {String} attr (optional) The attr to use for the path (defaults to the node's id)\r
- * @return {String} The path\r
- */\r
- getPath : function(attr){\r
- attr = attr || "id";\r
- var p = this.parentNode;\r
- var b = [this.attributes[attr]];\r
- while(p){\r
- b.unshift(p.attributes[attr]);\r
- p = p.parentNode;\r
- }\r
- var sep = this.getOwnerTree().pathSeparator;\r
- return sep + b.join(sep);\r
- },\r
-\r
- /**\r
- * Bubbles up the tree from this node, calling the specified function with each node. The arguments to the function\r
- * will be the args provided or the current node. If the function returns false at any point,\r
- * the bubble is stopped.\r
- * @param {Function} fn The function to call\r
- * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the function is executed. Defaults to the current Node.\r
- * @param {Array} args (optional) The args to call the function with (default to passing the current Node)\r
- */\r
- bubble : function(fn, scope, args){\r
- var p = this;\r
- while(p){\r
- if(fn.apply(scope || p, args || [p]) === false){\r
- break;\r
- }\r
- p = p.parentNode;\r
- }\r
- },\r
-\r
- /**\r
- * Cascades down the tree from this node, calling the specified function with each node. The arguments to the function\r
- * will be the args provided or the current node. If the function returns false at any point,\r
- * the cascade is stopped on that branch.\r
- * @param {Function} fn The function to call\r
- * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the function is executed. Defaults to the current Node.\r
- * @param {Array} args (optional) The args to call the function with (default to passing the current Node)\r
- */\r
- cascade : function(fn, scope, args){\r
- if(fn.apply(scope || this, args || [this]) !== false){\r
- var cs = this.childNodes;\r
- for(var i = 0, len = cs.length; i < len; i++) {\r
- cs[i].cascade(fn, scope, args);\r
- }\r
- }\r
- },\r
-\r
- /**\r
- * Interates the child nodes of this node, calling the specified function with each node. The arguments to the function\r
- * will be the args provided or the current node. If the function returns false at any point,\r
- * the iteration stops.\r
- * @param {Function} fn The function to call\r
- * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the function is executed. Defaults to the current Node in the iteration.\r
- * @param {Array} args (optional) The args to call the function with (default to passing the current Node)\r
- */\r
- eachChild : function(fn, scope, args){\r
- var cs = this.childNodes;\r
- for(var i = 0, len = cs.length; i < len; i++) {\r
- if(fn.apply(scope || this, args || [cs[i]]) === false){\r
- break;\r
- }\r
- }\r
- },\r
-\r
- /**\r
- * Finds the first child that has the attribute with the specified value.\r
- * @param {String} attribute The attribute name\r
- * @param {Mixed} value The value to search for\r
- * @return {Node} The found child or null if none was found\r
- */\r
- findChild : function(attribute, value){\r
- var cs = this.childNodes;\r
- for(var i = 0, len = cs.length; i < len; i++) {\r
- if(cs[i].attributes[attribute] == value){\r
- return cs[i];\r
- }\r
- }\r
- return null;\r
- },\r
-\r
- /**\r
- * Finds the first child by a custom function. The child matches if the function passed returns <code>true</code>.\r
- * @param {Function} fn A function which must return <code>true</code> if the passed Node is the required Node.\r
- * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the function is executed. Defaults to the Node being tested.\r
- * @return {Node} The found child or null if none was found\r
- */\r
- findChildBy : function(fn, scope){\r
- var cs = this.childNodes;\r
- for(var i = 0, len = cs.length; i < len; i++) {\r
- if(fn.call(scope||cs[i], cs[i]) === true){\r
- return cs[i];\r
- }\r
- }\r
- return null;\r
- },\r
-\r
- /**\r
- * Sorts this nodes children using the supplied sort function.\r
- * @param {Function} fn A function which, when passed two Nodes, returns -1, 0 or 1 depending upon required sort order.\r
- * @param {Object} scope (optional)The scope (<code>this</code> reference) in which the function is executed. Defaults to the browser window.\r
- */\r
- sort : function(fn, scope){\r
- var cs = this.childNodes;\r
- var len = cs.length;\r
- if(len > 0){\r
- var sortFn = scope ? function(){fn.apply(scope, arguments);} : fn;\r
- cs.sort(sortFn);\r
- for(var i = 0; i < len; i++){\r
- var n = cs[i];\r
- n.previousSibling = cs[i-1];\r
- n.nextSibling = cs[i+1];\r
- if(i === 0){\r
- this.setFirstChild(n);\r
- }\r
- if(i == len-1){\r
- this.setLastChild(n);\r
- }\r
- }\r
- }\r
- },\r
-\r
- /**\r
- * Returns true if this node is an ancestor (at any point) of the passed node.\r
- * @param {Node} node\r
- * @return {Boolean}\r
- */\r
- contains : function(node){\r
- return node.isAncestor(this);\r
- },\r
-\r
- /**\r
- * Returns true if the passed node is an ancestor (at any point) of this node.\r
- * @param {Node} node\r
- * @return {Boolean}\r
- */\r
- isAncestor : function(node){\r
- var p = this.parentNode;\r
- while(p){\r
- if(p == node){\r
- return true;\r
- }\r
- p = p.parentNode;\r
- }\r
- return false;\r
- },\r
-\r
- toString : function(){\r
- return "[Node"+(this.id?" "+this.id:"")+"]";\r
- }\r
-});/**
- * @class Ext.tree.TreeNode
- * @extends Ext.data.Node
- * @cfg {String} text The text for this node
- * @cfg {Boolean} expanded true to start the node expanded
- * @cfg {Boolean} allowDrag False to make this node undraggable if {@link #draggable} = true (defaults to true)
- * @cfg {Boolean} allowDrop False if this node cannot have child nodes dropped on it (defaults to true)
- * @cfg {Boolean} disabled true to start the node disabled
- * @cfg {String} icon The path to an icon for the node. The preferred way to do this
- * is to use the cls or iconCls attributes and add the icon via a CSS background image.
- * @cfg {String} cls A css class to be added to the node
- * @cfg {String} iconCls A css class to be added to the nodes icon element for applying css background images
- * @cfg {String} href URL of the link used for the node (defaults to #)
- * @cfg {String} hrefTarget target frame for the link
- * @cfg {Boolean} hidden True to render hidden. (Defaults to false).
- * @cfg {String} qtip An Ext QuickTip for the node
- * @cfg {Boolean} expandable If set to true, the node will always show a plus/minus icon, even when empty
- * @cfg {String} qtipCfg An Ext QuickTip config for the node (used instead of qtip)
- * @cfg {Boolean} singleClickExpand True for single click expand on this node
- * @cfg {Function} uiProvider A UI <b>class</b> to use for this node (defaults to Ext.tree.TreeNodeUI)
- * @cfg {Boolean} checked True to render a checked checkbox for this node, false to render an unchecked checkbox
- * (defaults to undefined with no checkbox rendered)
- * @cfg {Boolean} draggable True to make this node draggable (defaults to false)
- * @cfg {Boolean} isTarget False to not allow this node to act as a drop target (defaults to true)
- * @cfg {Boolean} allowChildren False to not allow this node to have child nodes (defaults to true)
- * @cfg {Boolean} editable False to not allow this node to be edited by an {@link Ext.tree.TreeEditor} (defaults to true)