Package: | Ext.tree |
Class: | TreePanel |
Extends: | Tree |
Defined In: | TreePanel.js |
Property | Defined By | |
---|---|---|
dragZone : Ext.tree.TreeDragZone | TreePanel | |
The dragZone used by this tree if drag is enabled | ||
dropZone : Ext.tree.TreeDropZone | TreePanel | |
The dropZone used by this tree if drop is enabled | ||
id : Object | TreePanel | |
Read-only. The id of the container element becomes this TreePanel's id. | ||
root : Node | Tree | |
The root node for this tree |
Method | Defined By | |
---|---|---|
TreePanel(String/HTMLElement/Element el , Object config ) |
TreePanel | |
addEvents(Object object ) : void |
Observable | |
Copies any events from the passed object onto this object if they do not already exist. The passed object must also ... | ||
addListener(String eventName , Function handler , [Object scope ], [Object options ]) : void |
Observable | |
Appends an event handler to this component | ||
collapseAll() : void | TreePanel | |
Collapse all nodes | ||
expandAll() : void | TreePanel | |
Expand all nodes | ||
expandPath(String path , [String attr ], [Function callback ]) : void |
TreePanel | |
Expands a specified path in this TreePanel. A path can be retrieved from a node with Ext.data.Node.getPath | ||
fireEvent(String eventName , Object... args ) : Boolean |
Observable | |
Fires the specified event with the passed parameters (minus the event name). | ||
getEl() : void | TreePanel | |
Returns the container element for this TreePanel | ||
getLoader() : void | TreePanel | |
Returns the default TreeLoader for this TreePanel | ||
getNodeById(String id ) : Node |
Tree | |
Gets a node in this tree by its id | ||
getRootNode() : Node | Tree | |
Returns this root node for this tree | ||
getSelectionModel() : void | TreePanel | |
Returns the selection model used by this TreePanel | ||
hasListener(String eventName ) : Boolean |
Observable | |
Checks to see if this object is currently listening for a specified event | ||
on(String eventName , Function handler , [Object options ]) : void |
Observable | |
Appends an event handler to this element (shorthand for addListener) | ||
purgeListeners() : void | Observable | |
Removes all listeners for this object | ||
removeListener(String eventName , Function handler , [Object scope ]) : void |
Observable | |
Removes a listener | ||
render() : void | TreePanel | |
Trigger rendering of this TreePanel | ||
selectPath(String path , [String attr ], [Function callback ]) : void |
TreePanel | |
Selects the node in this tree at the specified path. A path can be retrieved from a node with Ext.data.Node.getPath | ||
setRootNode(Node node ) : Node |
Tree | |
Sets the root node for this tree | ||
un(String eventName , Function handler , [Object scope ]) : void |
Observable | |
Removes a listener (shorthand for removeListener) |
Event | Defined By | |
---|---|---|
append : (Tree tree , Node parent , Node node , Number index ) |
Tree | |
Fires when a new child node is appended to a node in this tree. | ||
beforeappend : (Tree tree , Node parent , Node node ) |
Tree | |
Fires before a new child is appended to a node in this tree, return false to cancel the append. | ||
beforechildrenrendered : (Node node ) |
TreePanel | |
Fires right before the child nodes for a node are rendered | ||
beforeclick : (Node node , Ext.EventObject e ) |
TreePanel | |
Fires before click processing on a node. Return false to cancel the default action. | ||
beforecollapse : (Node node , Boolean deep , Boolean anim ) |
TreePanel | |
Fires before a node is collapsed, return false to cancel. | ||
beforeexpand : (Node node , Boolean deep , Boolean anim ) |
TreePanel | |
Fires before a node is expanded, return false to cancel. | ||
beforeinsert : (Tree tree , Node parent , Node node , Node refNode ) |
Tree | |
Fires before a new child is inserted in a node in this tree, return false to cancel the insert. | ||
beforeload : (Node node ) |
TreePanel | |
Fires before a node is loaded, return false to cancel | ||
beforemove : (Tree tree , Node node , Node oldParent , Node newParent , Number index ) |
Tree | |
Fires before a node is moved to a new location in the tree. Return false to cancel the move. | ||
beforenodedrop : (Object dropEvent ) |
TreePanel | |
Fires when a DD object is dropped on a node in this tree for preprocessing. Return false to cancel the drop. The drop... | ||
beforeremove : (Tree tree , Node parent , Node node ) |
Tree | |
Fires before a child is removed from a node in this tree, return false to cancel the remove. | ||
click : (Node node , Ext.EventObject e ) |
TreePanel | |
Fires when a node is clicked | ||
collapse : (Node node ) |
TreePanel | |
Fires when a node is collapsed | ||
contextmenu : (Node node , Ext.EventObject e ) |
TreePanel | |
Fires when a node is right clicked | ||
dblclick : (Node node , Ext.EventObject e ) |
TreePanel | |
Fires when a node is double clicked | ||
disabledchange : (Node node , Boolean disabled ) |
TreePanel | |
Fires when the disabled status of a node changes | ||
dragdrop : (Ext.tree.TreePanel this , Ext.tree.TreeNode node , DD dd , event e ) |
TreePanel | |
Fires when a dragged node is dropped on a valid DD target | ||
enddrag : (Ext.tree.TreePanel this , Ext.tree.TreeNode node , event e ) |
TreePanel | |
Fires when a drag operation is complete | ||
expand : (Node node ) |
TreePanel | |
Fires when a node is expanded | ||
insert : (Tree tree , Node parent , Node node , Node refNode ) |
Tree | |
Fires when a new child node is inserted in a node in this tree. | ||
load : (Node node ) |
TreePanel | |
Fires when a node is loaded | ||
move : (Tree tree , Node node , Node oldParent , Node newParent , Number index ) |
Tree | |
Fires when a node is moved to a new location in the tree | ||
nodedragover : (Object dragOverEvent ) |
TreePanel | |
Fires when a tree node is being targeted for a drag drop, return false to signal drop not allowed. The dragOverEvent ... | ||
nodedrop : (Object dropEvent ) |
TreePanel | |
Fires after a DD object is dropped on a node in this tree. The dropEvent passed to handlers has the following propert... | ||
remove : (Tree tree , Node parent , Node node ) |
Tree | |
Fires when a child node is removed from a node in this tree. | ||
startdrag : (Ext.tree.TreePanel this , Ext.tree.TreeNode node , event e ) |
TreePanel | |
Fires when a node starts being dragged | ||
textchange : (Node node , String text , String oldText ) |
TreePanel | |
Fires when the text for a node is changed |
Config Options | Defined By | |
---|---|---|
animate : Boolean | TreePanel | |
true to enable animated expand/collapse | ||
containerScroll : Boolean | TreePanel | |
true to register this container with ScrollManager | ||
ddAppendOnly : String | TreePanel | |
True if the tree should only allow append drops (use for trees which are sorted) | ||
ddGroup : String | TreePanel | |
The DD group this TreePanel belongs to | ||
ddScroll : Boolean | TreePanel | |
true to enable YUI body scrolling | ||
dragConfig : Object | TreePanel | |
Custom config to pass to the Ext.tree.TreeDragZone instance | ||
dropConfig : Object | TreePanel | |
Custom config to pass to the Ext.tree.TreeDropZone instance | ||
enableDD : Boolean | TreePanel | |
true to enable drag and drop | ||
enableDrag : Boolean | TreePanel | |
true to enable just drag | ||
enableDrop : Boolean | TreePanel | |
true to enable just drop | ||
hlColor : String | TreePanel | |
The color of the node highlight (defaults to C3DAF9) | ||
hlDrop : Boolean | TreePanel | |
false to disable node highlight on drop (defaults to true) | ||
lines : Boolean | TreePanel | |
false to disable tree lines (defaults to true) | ||
loader : Boolean | TreePanel | |
A TreeLoader for use with this TreePanel | ||
rootVisible : Boolean | TreePanel | |
false to hide the root node (defaults to true) | ||
selModel : Boolean | TreePanel | |
A tree selection model to use with this TreePanel (defaults to a Ext.tree.DefaultSelectionModel) | ||
singleExpand : Boolean | TreePanel | |
true if only 1 node per branch may be expanded |
public Ext.tree.TreeDragZone dragZone
public Ext.tree.TreeDropZone dropZone
public Object id
public function TreePanel(String/HTMLElement/Element el
, Object config
)
el
: String/HTMLElement/Elementconfig
: Objectpublic function addEvents(Object object
)
object
: Objectvoid
public function addListener(String eventName
, Function handler
, [Object scope
], [Object options
])
eventName
: Stringhandler
: Functionscope
: Objectoptions
: Object Combining Options
Using the options argument, it is possible to combine different types of listeners:
A normalized, delayed, one-time listener that auto stops the event and passes a custom argument (forumId)
el.on('click', this.onClick, this, { single: true, delay: 100, stopEvent : true, forumId: 4 });
The method also allows for a single argument to be passed which is a config object containing properties which specify multiple handlers.
Attaching multiple handlers in 1 call
Code:
el.on({ 'click' : { fn: this.onClick scope: this, delay: 100 }, 'mouseover' : { fn: this.onMouseOver scope: this }, 'mouseout' : { fn: this.onMouseOut scope: this } });
Or a shorthand syntax:
Code:
el.on({ 'click' : this.onClick, 'mouseover' : this.onMouseOver, 'mouseout' : this.onMouseOut scope: this });
void
public function collapseAll()
void
public function expandAll()
void
public function expandPath(String path
, [String attr
], [Function callback
])
path
: Stringattr
: Stringcallback
: Functionvoid
public function fireEvent(String eventName
, Object... args
)
eventName
: Stringargs
: Object...Boolean
public function getEl()
void
public function getLoader()
void
public function getNodeById(String id
)
id
: StringNode
public function getRootNode()
Node
public function getSelectionModel()
void
public function hasListener(String eventName
)
eventName
: StringBoolean
public function on(String eventName
, Function handler
, [Object options
])
eventName
: Stringhandler
: Functionoptions
: Objectvoid
public function purgeListeners()
void
public function removeListener(String eventName
, Function handler
, [Object scope
])
eventName
: Stringhandler
: Functionscope
: Objectvoid
public function render()
void
public function selectPath(String path
, [String attr
], [Function callback
])
path
: Stringattr
: Stringcallback
: Functionvoid
public function setRootNode(Node node
)
node
: NodeNode
public function un(String eventName
, Function handler
, [Object scope
])
eventName
: Stringhandler
: Functionscope
: Objectvoid
public event append
tree
: Treeparent
: Nodenode
: Nodeindex
: Numberpublic event beforeappend
tree
: Treeparent
: Nodenode
: Nodepublic event beforechildrenrendered
node
: Nodepublic event beforeclick
node
: Nodee
: Ext.EventObjectpublic event beforecollapse
node
: Nodedeep
: Booleananim
: Booleanpublic event beforeexpand
node
: Nodedeep
: Booleananim
: Booleanpublic event beforeinsert
tree
: Treeparent
: Nodenode
: NoderefNode
: Nodepublic event beforeload
node
: Nodepublic event beforemove
tree
: Treenode
: NodeoldParent
: NodenewParent
: Nodeindex
: Numberpublic event beforenodedrop
dropEvent
: Objectpublic event beforeremove
tree
: Treeparent
: Nodenode
: Nodepublic event click
node
: Nodee
: Ext.EventObjectpublic event collapse
node
: Nodepublic event contextmenu
node
: Nodee
: Ext.EventObjectpublic event dblclick
node
: Nodee
: Ext.EventObjectpublic event disabledchange
node
: Nodedisabled
: Booleanpublic event dragdrop
this
: Ext.tree.TreePanelnode
: Ext.tree.TreeNodedd
: DDe
: eventpublic event enddrag
this
: Ext.tree.TreePanelnode
: Ext.tree.TreeNodee
: eventpublic event expand
node
: Nodepublic event insert
tree
: Treeparent
: Nodenode
: NoderefNode
: Nodepublic event load
node
: Nodepublic event move
tree
: Treenode
: NodeoldParent
: NodenewParent
: Nodeindex
: Numberpublic event nodedragover
dragOverEvent
: Objectpublic event nodedrop
dropEvent
: Objectpublic event remove
tree
: Treeparent
: Nodenode
: Nodepublic event startdrag
this
: Ext.tree.TreePanelnode
: Ext.tree.TreeNodee
: eventpublic event textchange
node
: Nodetext
: StringoldText
: Stringanimate : Boolean
containerScroll : Boolean
ddAppendOnly : String
ddGroup : String
ddScroll : Boolean
dragConfig : Object
dropConfig : Object
enableDD : Boolean
enableDrag : Boolean
enableDrop : Boolean
hlColor : String
hlDrop : Boolean
lines : Boolean
loader : Boolean
rootVisible : Boolean
selModel : Boolean
singleExpand : Boolean