X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/2e847cf21b8ab9d15fa167b315ca5b2fa92638fc..6b044c28b5f26fb99c86c237ffad19741c0f7f3d:/docs/output/Ext.tree.TreePanel.html?ds=inline diff --git a/docs/output/Ext.tree.TreePanel.html b/docs/output/Ext.tree.TreePanel.html index d2420b12..fe42ec9d 100644 --- a/docs/output/Ext.tree.TreePanel.html +++ b/docs/output/Ext.tree.TreePanel.html @@ -1,77 +1,82 @@ -
Observable Component BoxComponent Container Panel 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 ...
- }]
+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 Options Defined By anchor : StringNote: this config is only used when this Component is rendered
by a Container which has been configured to use an Anc...Note: this config is only used when this Component is rendered
by a Container which has been configured to use an AnchorLayout (or subclass thereof).
@@ -141,7 +146,7 @@ element:
},
footerCfg: {
tag: 'h2',
- cls: 'x-panel-footer' // same as the Default class
+ cls: 'x-panel-footer', // same as the Default class
html: 'footer html'
},
footerCssClass: 'custom-footer', // additional css class, see addClass
@@ -162,9 +167,9 @@ Warning: This will override any size manag...The maxi
Warning: This will override any size mana...
The minimum value in pixels which this BoxComponent will set its height to.
Warning: This will override any size management applied by layout managers.
BoxComponent boxMinWidth : NumberThe minimum value in pixels which this BoxComponent will set its width to.
Warning: This will override any size manag...The minimum value in pixels which this BoxComponent will set its width to.
-Warning: This will override any size management applied by layout managers.
BoxComponent bubbleEvents : ArrayAn array of events that, when fired, should be bubbled to any parent container.
-See Ext.util.Observable.enableBubble...An array of events that, when fired, should be bubbled to any parent container.
-See Ext.util.Observable.enableBubble.
+
Warning: This will override any size management applied by layout managers.
BoxComponent bubbleEvents : ArrayAn array of events that, when fired, should be bubbled to any parent container.
+See Ext.util.Observable.enableBubble....An array of events that, when fired, should be bubbled to any parent container.
+See Ext.util.Observable.enableBubble.
Defaults to [].
TreePanel buttonAlign : StringThe alignment of any buttons added to this panel. Valid values are 'right',
'left' and 'center' (defaults to 'right'...The alignment of any buttons added to this panel. Valid values are 'right'
,
'left'
and 'center'
(defaults to 'right'
). Panel buttons : Arraybuttons will be used as items for the toolbar in
@@ -907,14 +912,12 @@ Note: see the Note for el al...The Panel's header Note: see the Note for el
also.
Panel hidden : BooleanTrue if this component is hidden. Read-only. Component initialConfig : ObjectThis Component's initial configuration specification. Read-only. Component ownerCt : Ext.ContainerThis Component's owner Container (defaults to undefined, and is set automatically when
this Component is added to a C... Component private : ObjectWe can only lay out if there is a view area in which to layout.
-display:none on the layout target, *or any of its par...We can only lay out if there is a view area in which to layout.
-display:none on the layout target, *or any of its parent elements* will mean it has no view area. Container refOwner : Ext.ContainerThe ancestor Container into which the ref reference was inserted if this Component
+Note: to access items within the Container see itemId.
Component refOwner : Ext.ContainerThe ancestor Container into which the ref reference was inserted if this Component
is a child of a Container, and has...The ancestor Container into which the ref reference was inserted if this Component
is a child of a Container, and has been configured with a ref
. Component rendered : BooleanTrue if this component has been rendered. Read-only. Component root : Ext.tree.TreeNodeThe root node of this tree. TreePanel
Public Methods
Method Defined By TreePanel( Object config
)
- Parameters:config
: Object
Returns:- void
TreePanel add( Object/Array component
, Object (Optional)
, Object (Optional)
)
+ Parameters:config
: Object
Returns:- void
TreePanel add( ...Object/Array component
)
:
- Ext.ComponentAdds Component(s) to this Container.
+ Ext.Component/ArrayAdds Component(s) to this Container.
Description :
<ul class="mdetail-params">
Fires the beforeadd event before addin...Adds Component(s) to this Container.
@@ -939,8 +942,8 @@ tb.BorderLayout
for more details.
-Parameters:component
: Object/ArrayEither a single component or an Array of components to add. See
-items
for additional information.
(Optional)
: Objectcomponent_2(Optional)
: Objectcomponent_n
Returns:Ext.Component
component The Component (or config object) that was added.
Container addButton( String/Object config
, Function handler
, Object scope
)
+Parameters:component
: ...Object/ArrayEither one or more Components to add or an Array of Components to add. See
+items
for additional information.
Returns:Ext.Component/Array
The Components that were added.
Container addButton( String/Object config
, Function handler
, Object scope
)
:
Ext.ButtonAdds a button to this panel. Note that this method must be called prior to rendering. The preferred
approach is to ...Adds a button to this panel. Note that this method must be called prior to rendering. The preferred
@@ -1002,12 +1005,12 @@ Or a shorthand syntax:
'mouseover' : this.onMouseOver,
'mouseout' : this.onMouseOut,
scope: this
-});Returns:- void
Observable bubble( Function fn
, [Object scope
], [Array args
] )
+});Returns:- void
Observable bubble( Function fn
, [Object scope
], [Array args
] )
:
- Ext.ContainerBubbles up the component/container heirarchy, calling the specified function with each component. The scope (this) of...Bubbles up the component/container heirarchy, calling the specified function with each component. The scope (this) of
+ Ext.ComponentBubbles up the component/container heirarchy, calling the specified function with each component. The scope (this) of...Bubbles up the component/container heirarchy, calling the specified function with each component. The scope (this) of
function call will be the scope provided or the current component. The arguments to the function
will be the args provided or the current component. If the function returns false at any point,
-the bubble is stopped.Parameters:fn
: FunctionThe function to callscope
: Object(optional) The scope of the function (defaults to current node)args
: Array(optional) The args to call the function with (default to passing the current component)
Returns:Ext.Container
this
Container cloneConfig( Object overrides
)
+the bubble is stopped.Parameters:fn
: FunctionThe function to callscope
: Object(optional) The scope of the function (defaults to current node)args
: Array(optional) The args to call the function with (default to passing the current component)
Returns:Ext.Component
this
Component cloneConfig( Object overrides
)
:
Ext.ComponentClone the current component using the original config values passed into this instance by default.Clone the current component using the original config values passed into this instance by default.Parameters:overrides
: ObjectA new config containing any properties to override in the cloned version.
An id property can be passed on this object, otherwise one will be generated to avoid duplicates.
Returns:Ext.Component
clone The cloned copy of this component
Component collapse( Boolean animate
)
@@ -1025,38 +1028,38 @@ removing the component from its Ext.ComponentMgr. Destruction is generally handled automatically by the framework and this method
should usually not need to be called directly.Parameters:- None.
Returns:- void
Component enableBubble( String/Array events
)
:
- voidEnables events fired by this Observable to bubble up an owner hierarchy by calling
-this.getBubbleTarget() if present...Enables events fired by this Observable to bubble up an owner hierarchy by calling
-this.getBubbleTarget()
if present. There is no implementation in the Observable base class.
-This is commonly used by Ext.Components to bubble events to owner Containers. See Ext.Component.getBubbleTarget. The default
-implementation in Ext.Component returns the Component's immediate owner. But if a known target is required, this can be overridden to
-access the required target more quickly.
-Example:
Ext.override(Ext.form.Field, {
- // Add functionality to Field's initComponent to enable the change event to bubble
- initComponent : Ext.form.Field.prototype.initComponent.createSequence(function() {
- this.enableBubble('change');
- }),
-
- // We know that we want Field's events to bubble directly to the FormPanel.
- getBubbleTarget : function() {
- if (!this.formPanel) {
- this.formPanel = this.findParentByType('form');
- }
- return this.formPanel;
- }
-});
-
-var myForm = new Ext.formPanel({
- title: 'User Details',
- items: [{
- ...
- }],
- listeners: {
- change: function() {
- // Title goes red if form has been modified.
- myForm.header.setStyle('color', 'red');
- }
- }
+ voidEnables events fired by this Observable to bubble up an owner hierarchy by calling
+this.getBubbleTarget() if present....Enables events fired by this Observable to bubble up an owner hierarchy by calling
+this.getBubbleTarget()
if present. There is no implementation in the Observable base class.
+This is commonly used by Ext.Components to bubble events to owner Containers. See Ext.Component.getBubbleTarget. The default
+implementation in Ext.Component returns the Component's immediate owner. But if a known target is required, this can be overridden to
+access the required target more quickly.
+Example:
Ext.override(Ext.form.Field, {
+ // Add functionality to Field's initComponent to enable the change event to bubble
+ initComponent : Ext.form.Field.prototype.initComponent.createSequence(function() {
+ this.enableBubble('change');
+ }),
+
+ // We know that we want Field's events to bubble directly to the FormPanel.
+ getBubbleTarget : function() {
+ if (!this.formPanel) {
+ this.formPanel = this.findParentByType('form');
+ }
+ return this.formPanel;
+ }
+});
+
+var myForm = new Ext.formPanel({
+ title: 'User Details',
+ items: [{
+ ...
+ }],
+ listeners: {
+ change: function() {
+ // Title goes red if form has been modified.
+ myForm.header.setStyle('color', 'red');
+ }
+ }
});
Parameters:events
: String/ArrayThe event name to bubble, or an Array of event names.
Returns:- void
Observable expand( Boolean animate
)
:
Ext.PanelExpands the panel body so that it becomes visible. Fires the beforeexpand event which will
@@ -1066,14 +1069,16 @@ cancel the expand action if it returns false.Expand all nodesExpand all nodesParameters:- None.
Returns:- void
TreePanel expandPath( String path
, [String attr
], [Function callback
] )
:
- voidExpands a specified path in this TreePanel. A path can be retrieved from a node with Ext.data.Node.getPathExpands a specified path in this TreePanel. A path can be retrieved from a node with Ext.data.Node.getPathParameters:path
: Stringattr
: String(optional) The attribute used in the path (see Ext.data.Node.getPath for more info)callback
: Function(optional) The callback to call when the expand is complete. The callback will be called with
+ voidExpands a specified path in this TreePanel. A path can be retrieved from a node with Ext.data.Node.getPathExpands a specified path in this TreePanel. A path can be retrieved from a node with Ext.data.Node.getPathParameters:path
: Stringattr
: String(optional) The attribute used in the path (see Ext.data.Node.getPath for more info)callback
: Function(optional) The callback to call when the expand is complete. The callback will be called with
(bSuccess, oLastNode) where bSuccess is if the expand was successful and oLastNode is the last node that was expanded.
Returns:- void
TreePanel findParentBy( Function fn
)
:
Ext.ContainerFind a container above this component at any level by a custom function. If the passed function returns
true, the con...Find a container above this component at any level by a custom function. If the passed function returns
-true, the container will be returned.Parameters:fn
: FunctionThe custom function to call with the arguments (container, this component).
Returns:Ext.Container
The first Container for which the custom function returns true
Component findParentByType( String/Class xtype
)
+true, the container will be returned.Parameters:fn
: FunctionThe custom function to call with the arguments (container, this component).
Returns:Ext.Container
The first Container for which the custom function returns true
Component findParentByType( String/Ext.Component/Class xtype
, [Boolean shallow
] )
:
- Ext.ContainerFind a container above this component at any level by xtype or classFind a container above this component at any level by xtype or classParameters:xtype
: String/ClassThe xtype string for a component, or the class of the component directly
Returns:Ext.Container
The first Container which matches the given xtype or class
Component fireEvent( String eventName
, Object... args
)
+ Ext.ContainerFind a container above this component at any level by xtype or classFind a container above this component at any level by xtype or classParameters:xtype
: String/Ext.Component/ClassThe xtype to check for this Component. Note that the the component can either be an instance
+or a component class:shallow
: Boolean(optional) False to check whether this Component is descended from the xtype (this is
+the default), or true to check whether this Component is directly of the specified xtype.
Returns:Ext.Container
The first Container which matches the given xtype or class
Component fireEvent( String eventName
, Object... args
)
:
BooleanFires the specified event with the passed parameters (minus the event name).
An event may be set to bubble up an Obse...Fires the specified event with the passed parameters (minus the event name).
@@ -1108,7 +1113,9 @@ or use a render listener directly:new Ext.Panel({
},
single: true // Remove the listener after first invocation
}
-});
Parameters:- None.
Returns:Ext.Element
The Element which encapsulates this Component.
Component getFrameHeight()
+});Parameters:- None.
Returns:Ext.Element
The Element which encapsulates this Component.
Component getFooterToolbar()
+ :
+ Ext.Toolbar Panel getFrameHeight()
:
NumberReturns the height in pixels of the framing elements of this panel (including any top and bottom bars and
header and ...Returns the height in pixels of the framing elements of this panel (including any top and bottom bars and
@@ -1199,7 +1206,7 @@ false to cancel hiding the component. Fires the 'h...Hi
event after hiding the component. Note this method is called internally if
the component is configured to be hidden
.Parameters:- None.
Returns:Ext.Component
this
Component isVisible()
:
- BooleanReturns true if this component is visible.Returns true if this component is visible.Parameters:- None.
Returns:Boolean
True if this component is visible, false otherwise.
Component isXType( String xtype
, [Boolean shallow
] )
+ BooleanReturns true if this component is visible.Returns true if this component is visible.Parameters:- None.
Returns:Boolean
True if this component is visible, false otherwise.
Component isXType( String/Ext.Component/Class xtype
, [Boolean shallow
] )
:
BooleanTests whether or not this Component is of a specific xtype. This can test whether this Component is descended
from th...Tests whether or not this Component is of a specific xtype. This can test whether this Component is descended
@@ -1211,7 +1218,11 @@ to participate in determination of inherited xtypes.
var t = new Ext.form.TextField();
var isText = t.isXType('textfield'); // true
var isBoxSubclass = t.isXType('box'); // true, descended from BoxComponent
-var isBoxInstance = t.isXType('box', true); // false, not a direct BoxComponent instance
Parameters:xtype
: StringThe xtype to check for this Componentshallow
: Boolean(optional) False to check whether this Component is descended from the xtype (this is
+var isBoxInstance = t.isXType('box', true); // false, not a direct BoxComponent instanceParameters:xtype
: String/Ext.Component/ClassThe xtype to check for this Component. Note that the the component can either be an instance
+or a component class:
+var c = new Ext.Component();
+console.log(c.isXType(c));
+console.log(c.isXType(Ext.Component));
shallow
: Boolean(optional) False to check whether this Component is descended from the xtype (this is
the default), or true to check whether this Component is directly of the specified xtype.
Returns:Boolean
True if this component descends from the specified xtype, false otherwise.
Component mon( Observable|Element item
, Object|String ename
, Function fn
, Object scope
, Object opt
)
:
voidAdds listeners to any Observable object (or Elements) which are automatically removed when this Component
@@ -1278,13 +1289,13 @@ event...Resume firing events. (see Parameters:- None.
Returns:- void
Observable selectPath( String path
, [String attr
], [Function callback
] )
:
- voidSelects the node in this tree at the specified path. A path can be retrieved from a node with Ext.data.Node.getPathSelects the node in this tree at the specified path. A path can be retrieved from a node with Ext.data.Node.getPathParameters:path
: Stringattr
: String(optional) The attribute used in the path (see Ext.data.Node.getPath for more info)callback
: Function(optional) The callback to call when the selection is complete. The callback will be called with
+ voidSelects the node in this tree at the specified path. A path can be retrieved from a node with Ext.data.Node.getPathSelects the node in this tree at the specified path. A path can be retrieved from a node with Ext.data.Node.getPathParameters:path
: Stringattr
: String(optional) The attribute used in the path (see Ext.data.Node.getPath for more info)callback
: Function(optional) The callback to call when the selection is complete. The callback will be called with
(bSuccess, oSelNode) where bSuccess is if the selection was successful and oSelNode is the selected node.
Returns:- void
TreePanel setAutoScroll( Boolean scroll
)
:
- Ext.BoxComponentSets the overflow on the content element of the component.Sets the overflow on the content element of the component.Parameters:scroll
: BooleanTrue to allow the Component to auto scroll.
Returns:Ext.BoxComponent
this
BoxComponent setHeight( Number height
)
+ Ext.BoxComponentSets the overflow on the content element of the component.Sets the overflow on the content element of the component.Parameters:scroll
: BooleanTrue to allow the Component to auto scroll.
Returns:Ext.BoxComponent
this
BoxComponent setHeight( Mixed height
)
:
- Ext.BoxComponentSets the height of the component. This method fires the resize event.Sets the height of the component. This method fires the resize event.Parameters:height
: NumberThe new height to set. This may be one of:
-- A Number specifying the new height in the Element's Ext.Element.defaultUnits (by default, pixels).
+ Ext.BoxComponentSets the height of the component. This method fires the resize event.Sets the height of the component. This method fires the resize event.Parameters:height
: MixedThe new height to set. This may be one of:
+- A Number specifying the new height in the Element's defaultUnits (by default, pixels).
- A String used to set the CSS height style.
- undefined to leave the height unchanged.
Returns:Ext.BoxComponent
this
BoxComponent setIconClass( String cls
)
@@ -1301,8 +1312,8 @@ This method fires the Sets the left and top of the component. To set the page XY position instead, use setPagePosition.
This method fires the move event.Parameters:left
: NumberThe new lefttop
: NumberThe new top
Returns:Ext.BoxComponent
this
BoxComponent setRootNode( Node node
)
:
- NodeSets the root node for this tree. If the TreePanel has already rendered a root node, the
-previous root node (and all...Sets the root node for this tree. If the TreePanel has already rendered a root node, the
+ NodeSets the root node for this tree. If the TreePanel has already rendered a root node, the
+previous root node (and all ...Sets the root node for this tree. If the TreePanel has already rendered a root node, the
previous root node (and all of its descendants) are destroyed before the new root node is rendered.Parameters:node
: Node
Returns:Node
TreePanel setSize( Mixed width
, Mixed height
)
:
Ext.BoxComponentSets the width and height of this BoxComponent. This method fires the resize event. This method can accept
@@ -1325,10 +1336,10 @@ In order to be able to set the title, a header eleme... Panel setVisible( Boolean visible
)
:
- Ext.ComponentConvenience function to hide or show this component by boolean.Convenience function to hide or show this component by boolean.Parameters:visible
: BooleanTrue to show, false to hide
Returns:Ext.Component
this
Component setWidth( Number width
)
+ Ext.ComponentConvenience function to hide or show this component by boolean.Convenience function to hide or show this component by boolean.Parameters:visible
: BooleanTrue to show, false to hide
Returns:Ext.Component
this
Component setWidth( Mixed width
)
:
- Ext.BoxComponentSets the width of the component. This method fires the resize event.Sets the width of the component. This method fires the resize event.Parameters:width
: NumberThe new width to setThis may be one of:
-- A Number specifying the new width in the Element's Ext.Element.defaultUnits (by default, pixels).
+ Ext.BoxComponentSets the width of the component. This method fires the resize event.Sets the width of the component. This method fires the resize event.Parameters:width
: MixedThe new width to set. This may be one of:
+- A Number specifying the new width in the Element's defaultUnits (by default, pixels).
- A String used to set the CSS width style.
Returns:Ext.BoxComponent
this
BoxComponent show()
:
@@ -1406,20 +1417,20 @@ Return false from an event handler to stop the hide.
( Tree tree
, Node node
, Node oldParent
, Node newParent
, Number index
)
Fires before a node is moved to a new location in the tree. Return false to cancel the move.Fires before a node is moved to a new location in the tree. Return false to cancel the move.Listeners will be called with the following arguments:tree
: TreeThe owner treenode
: NodeThe node being movedoldParent
: NodeThe parent of the nodenewParent
: NodeThe new parent the node is moving toindex
: NumberThe index it is being moved to
TreePanel beforenodedrop :
( Object dropEvent
)
- Fires when a DD object is dropped on a node in this tree for preprocessing. Return false to cancel the drop. The drop...Fires when a DD object is dropped on a node in this tree for preprocessing. Return false to cancel the drop. The dropEvent
-passed to handlers has the following properties:
-
-- tree - The TreePanel
-- target - The node being targeted for the drop
-- data - The drag data from the drag source
-- point - The point of the drop - append, above or below
-- source - The drag source
-- rawEvent - Raw mouse event
-- dropNode - Drop node(s) provided by the source OR you can supply node(s)
-to be inserted by setting them on this object.
-- cancel - Set this to true to cancel the drop.
-- dropStatus - If the default drop action is cancelled but the drop is valid, setting this to true
-will prevent the animated 'repair' from appearing.
+ Fires when a DD object is dropped on a node in this tree for preprocessing. Return false to cancel the drop. The drop...Fires when a DD object is dropped on a node in this tree for preprocessing. Return false to cancel the drop. The dropEvent
+passed to handlers has the following properties:
+
+- tree - The TreePanel
+- target - The node being targeted for the drop
+- data - The drag data from the drag source
+- point - The point of the drop - append, above or below
+- source - The drag source
+- rawEvent - Raw mouse event
+- dropNode - Drop node(s) provided by the source OR you can supply node(s)
+to be inserted by setting them on this object.
+- cancel - Set this to true to cancel the drop.
+- dropStatus - If the default drop action is cancelled but the drop is valid, setting this to true
+will prevent the animated 'repair' from appearing.
Listeners will be called with the following arguments:dropEvent
: Object
TreePanel beforeremove :
( Tree tree
, Node parent
, Node node
)
Fires before a child is removed from a node in this tree, return false to cancel the remove.Fires before a child is removed from a node in this tree, return false to cancel the remove.Listeners will be called with the following arguments:tree
: TreeThe owner treeparent
: NodeThe parent nodenode
: NodeThe child node to be removed
TreePanel beforerender :
@@ -1462,46 +1473,46 @@ Panel subclasses do (like
( Tree this
, Ext.EventObject e
)
Fires when the tree container is double clickedFires when the tree container is double clickedListeners will be called with the following arguments:this
: Treee
: Ext.EventObjectThe event object
TreePanel contextmenu :
( Node node
, Ext.EventObject e
)
- Fires when a node is right clicked. To display a context menu in response to this
-event, first create a Menu object ...Fires when a node is right clicked. To display a context menu in response to this
-event, first create a Menu object (see Ext.menu.Menu for details), then add
-a handler for this event:new Ext.tree.TreePanel({
- title: 'My TreePanel',
- root: new Ext.tree.AsyncTreeNode({
- text: 'The Root',
- children: [
- { text: 'Child node 1', leaf: true },
- { text: 'Child node 2', leaf: true }
- ]
- }),
- contextMenu: new Ext.menu.Menu({
- items: [{
- id: 'delete-node',
- text: 'Delete Node'
- }],
- listeners: {
- itemclick: function(item) {
- switch (item.id) {
- case 'delete-node':
- var n = item.parentMenu.contextNode;
- if (n.parentNode) {
- n.remove();
- }
- break;
- }
- }
- }
- }),
- listeners: {
- contextmenu: function(node, e) {
-// Register the context node with the menu so that a Menu Item's handler function can access
-// it via its parentMenu property.
- node.select();
- var c = node.getOwnerTree().contextMenu;
- c.contextNode = node;
- c.showAt(e.getXY());
- }
- }
+ Fires when a node is right clicked. To display a context menu in response to this
+event, first create a Menu object (...Fires when a node is right clicked. To display a context menu in response to this
+event, first create a Menu object (see Ext.menu.Menu for details), then add
+a handler for this event:new Ext.tree.TreePanel({
+ title: 'My TreePanel',
+ root: new Ext.tree.AsyncTreeNode({
+ text: 'The Root',
+ children: [
+ { text: 'Child node 1', leaf: true },
+ { text: 'Child node 2', leaf: true }
+ ]
+ }),
+ contextMenu: new Ext.menu.Menu({
+ items: [{
+ id: 'delete-node',
+ text: 'Delete Node'
+ }],
+ listeners: {
+ itemclick: function(item) {
+ switch (item.id) {
+ case 'delete-node':
+ var n = item.parentMenu.contextNode;
+ if (n.parentNode) {
+ n.remove();
+ }
+ break;
+ }
+ }
+ }
+ }),
+ listeners: {
+ contextmenu: function(node, e) {
+// Register the context node with the menu so that a Menu Item's handler function can access
+// it via its parentMenu property.
+ node.select();
+ var c = node.getOwnerTree().contextMenu;
+ c.contextNode = node;
+ c.showAt(e.getXY());
+ }
+ }
});
Listeners will be called with the following arguments:node
: NodeThe nodee
: Ext.EventObjectThe event object
TreePanel dblclick :
( Node node
, Ext.EventObject e
)
Fires when a node is double clickedFires when a node is double clickedListeners will be called with the following arguments:node
: NodeThe nodee
: Ext.EventObjectThe event object
TreePanel deactivate :
@@ -1542,30 +1553,31 @@ Fires after the component is hidden when calling the Fires when a node is moved to a new location in the treeFires when a node is moved to a new location in the treeListeners will be called with the following arguments:tree
: TreeThe owner treenode
: NodeThe node movedoldParent
: NodeThe old parent of this nodenewParent
: NodeThe new parent of this nodeindex
: NumberThe index it was moved to
TreePanel nodedragover :
( Object dragOverEvent
)
- Fires when a tree node is being targeted for a drag drop, return false to signal drop not allowed. The dragOverEvent
...Fires when a tree node is being targeted for a drag drop, return false to signal drop not allowed. The dragOverEvent
-passed to handlers has the following properties:
-
-- tree - The TreePanel
-- target - The node being targeted for the drop
-- data - The drag data from the drag source
-- point - The point of the drop - append, above or below
-- source - The drag source
-- rawEvent - Raw mouse event
-- dropNode - Drop node(s) provided by the source.
-- cancel - Set this to true to signal drop not allowed.
+ Fires when a tree node is being targeted for a drag drop, return false to signal drop not allowed. The dragOverEvent
+...Fires when a tree node is being targeted for a drag drop, return false to signal drop not allowed. The dragOverEvent
+passed to handlers has the following properties:
+
+- tree - The TreePanel
+- target - The node being targeted for the drop
+- data - The drag data from the drag source
+- point - The point of the drop - append, above or below
+- source - The drag source
+- rawEvent - Raw mouse event
+- dropNode - Drop node(s) provided by the source.
+- cancel - Set this to true to signal drop not allowed.
Listeners will be called with the following arguments:dragOverEvent
: Object
TreePanel nodedrop :
( Object dropEvent
)
- Fires after a DD object is dropped on a node in this tree. The dropEvent
-passed to handlers has the following proper...Fires after a DD object is dropped on a node in this tree. The dropEvent
-passed to handlers has the following properties:
-
-- tree - The TreePanel
-- target - The node being targeted for the drop
-- data - The drag data from the drag source
-- point - The point of the drop - append, above or below
-- source - The drag source
-- rawEvent - Raw mouse event
-- dropNode - Dropped node(s).
+ Fires after a DD object is dropped on a node in this tree. The dropEvent
+passed to handlers has the following propert...Fires after a DD object is dropped on a node in this tree. The dropEvent
+passed to handlers has the following properties:
+
+- tree - The TreePanel
+- target - The node being targeted for the drop
+- data - The drag data from the drag source
+- point - The point of the drop - append, above or below
+- source - The drag source
+- rawEvent - Raw mouse event
+- dropNode - Dropped node(s).
Listeners will be called with the following arguments:dropEvent
: Object
TreePanel remove :
( Tree tree
, Node parent
, Node node
)
Fires when a child node is removed from a node in this tree.Fires when a child node is removed from a node in this tree.Listeners will be called with the following arguments:tree
: TreeThe owner treeparent
: NodeThe parent nodenode
: NodeThe child node removed
TreePanel removed :