|
| Node( Object attributes )
- | Node |
| addEvents( Object object )
+ | Node |
| addEvents( Object|String o , string Optional. )
:
- voidUsed to define events on this Observable Used to define events on this Observable | Observable |
| addListener( String eventName , Function handler , [Object scope ], [Object options ] )
+ voidAdds the specified events to the list of events which this Observable may fire. Adds the specified events to the list of events which this Observable may fire. | Observable |
| addListener( String eventName , Function handler , [Object scope ], [Object options ] )
:
voidAppends an event handler to this object. Appends an event handler to this object. Parameters:eventName : StringThe name of the event to listen for. handler : FunctionThe method the event invokes. scope : Object(optional) The scope (this reference) in which the handler function is executed.
If omitted, defaults to the object which fired the event. options : Object(optional) An object containing handler configuration.
@@ -77,8 +80,8 @@ Using the options argument, it is possible to combine different types of listene
A delayed, one-time listener.
myDataView.on('click', this.onClick, this, {
- single: true,
- delay: 100
+single: true,
+delay: 100
});
Attaching multiple handlers in 1 call
@@ -86,58 +89,87 @@ The method also allows for a single argument to be passed which is a config obje
which specify multiple handlers.
myGridPanel.on({
- 'click' : {
- fn: this.onClick,
- scope: this,
- delay: 100
- },
- 'mouseover' : {
- fn: this.onMouseOver,
- scope: this
- },
- 'mouseout' : {
- fn: this.onMouseOut,
- scope: this
- }
+'click' : {
+ fn: this.onClick,
+ scope: this,
+ delay: 100
+},
+'mouseover' : {
+ fn: this.onMouseOver,
+ scope: this
+},
+'mouseout' : {
+ fn: this.onMouseOut,
+ scope: this
+}
});
Or a shorthand syntax:
myGridPanel.on({
- 'click' : this.onClick,
- 'mouseover' : this.onMouseOver,
- 'mouseout' : this.onMouseOut,
- scope: this
+'click' : this.onClick,
+'mouseover' : this.onMouseOver,
+'mouseout' : this.onMouseOut,
+ scope: this
});
Returns: | Observable |
| appendChild( Node/Array node )
:
NodeInsert node(s) as the last child node of this node. Insert node(s) as the last child node of this node. | Node |
| bubble( Function fn , [Object scope ], [Array args ] )
:
- voidBubbles up the tree from this node, calling the specified function with each node. The scope (this) of
-function call... Bubbles up the tree from this node, calling the specified function with each node. The scope ( this) of
-function call will be the scope provided or the current node. The arguments to the function
-will be the args provided or the current node. If the function returns false at any point,
-the bubble is stopped. | Node |
| cascade( Function fn , [Object scope ], [Array args ] )
- :
- voidCascades down the tree from this node, calling the specified function with each node. The scope (this) of
-function c... Cascades down the tree from this node, calling the specified function with each node. The scope ( this) of
-function call will be the scope provided or the current node. The arguments to the function
-will be the args provided or the current node. If the function returns false at any point,
-the cascade is stopped on that branch. | Node |
| contains( Node node )
- :
- BooleanReturns true if this node is an ancestor (at any point) of the passed node. Returns true if this node is an ancestor (at any point) of the passed node. | Node |
| eachChild( Function fn , [Object scope ], [Array args ] )
- :
- voidInterates the child nodes of this node, calling the specified function with each node. The scope (this) of
-function ... Interates the child nodes of this node, calling the specified function with each node. The scope ( this) of
-function call will be the scope provided or the current node. The arguments to the function
-will be the args provided or the current node. If the function returns false at any point,
-the iteration stops. | Node |
| enableBubble( Object events )
- :
- voidUsed to enable bubbling of events Used to enable bubbling of events | Observable |
| findChild( String attribute , Mixed value )
+ voidBubbles up the tree from this node, calling the specified function with each node. The arguments to the function
+will... Bubbles up the tree from this node, calling the specified function with each node. The arguments to the function
+will be the args provided or the current node. If the function returns false at any point,
+the bubble is stopped. | Node |
| cascade( Function fn , [Object scope ], [Array args ] )
+ :
+ voidCascades down the tree from this node, calling the specified function with each node. The arguments to the function
+w... Cascades down the tree from this node, calling the specified function with each node. The arguments to the function
+will be the args provided or the current node. If the function returns false at any point,
+the cascade is stopped on that branch. | Node |
| contains( Node node )
+ :
+ BooleanReturns true if this node is an ancestor (at any point) of the passed node. Returns true if this node is an ancestor (at any point) of the passed node. | Node |
| destroy()
+ :
+ void | Node |
| eachChild( Function fn , [Object scope ], [Array args ] )
+ :
+ voidInterates the child nodes of this node, calling the specified function with each node. The arguments to the function
+... Interates the child nodes of this node, calling the specified function with each node. The arguments to the function
+will be the args provided or the current node. If the function returns false at any point,
+the iteration stops. Parameters:fn : FunctionThe function to call scope : Object(optional) The scope (this reference) in which the function is executed. Defaults to the current Node in the iteration. args : Array(optional) The args to call the function with (default to passing the current Node) Returns: | Node |
| 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');
+ }
+ }
+});
| Observable |
| findChild( String attribute , Mixed value , [Boolean deep ] )
:
- NodeFinds the first child that has the attribute with the specified value. Finds the first child that has the attribute with the specified value. Parameters:attribute : StringThe attribute name value : MixedThe value to search for Returns: | Node |
| findChildBy( Function fn , [Object scope ] )
+ NodeFinds the first child that has the attribute with the specified value. Finds the first child that has the attribute with the specified value. | Node |
| findChildBy( Function fn , [Object scope ], [Boolean deep ] )
:
- NodeFinds the first child by a custom function. The child matches if the function passed
-returns true. Finds the first child by a custom function. The child matches if the function passed
-returns true. Parameters:fn : Functionscope : Object(optional) Returns: | Node |
| fireEvent( String eventName , Object... args )
+ NodeFinds the first child by a custom function. The child matches if the function passed returns true. Finds the first child by a custom function. The child matches if the function passed returns true . Parameters:fn : FunctionA function which must return true if the passed Node is the required Node. scope : Object(optional) The scope (this reference) in which the function is executed. Defaults to the Node being tested. deep : Boolean(Optional) True to search through nodes deeper than the immediate children Returns: | Node |
| 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... | Node |
| isExpandable()
:
- BooleanReturns true if this node has one or more child nodes, or if the expandable
-node attribute is explicitly specified a... Returns true if this node has one or more child nodes, or if the expandable
+ Boolean Returns true if this node has one or more child nodes, or if the expandable
+node attribute is explicitly specified as... Returns true if this node has one or more child nodes, or if the expandable
node attribute is explicitly specified as true (see attributes), otherwise returns false. | Node |
| isFirst()
:
BooleanReturns true if this node is the first child of its parent Returns true if this node is the first child of its parent | Node |
| isLast()
@@ -177,11 +209,13 @@ node attribute is explicitly specified as true (see Removes all listeners for this object Removes all listeners for this object | Observable |
| relayEvents( Object o , Array events )
:
- voidRelays selected events from the specified Observable as if the events were fired by this. Relays selected events from the specified Observable as if the events were fired by this. | Observable |
| remove()
+ voidRelays selected events from the specified Observable as if the events were fired by this. Relays selected events from the specified Observable as if the events were fired by this. | Observable |
| remove( Boolean destroy )
+ :
+ NodeRemoves this node from its parent Removes this node from its parent | Node |
| removeAll( Boolean destroy )
:
- NodeRemoves this node from its parent Removes this node from its parent | Node |
| removeChild( Node node )
+ NodeRemoves all child nodes from this node. Removes all child nodes from this node. | Node |
| removeChild( Node node , Boolean destroy )
:
- NodeRemoves a child node from this node. Removes a child node from this node. Parameters:node : NodeThe node to remove Returns: | Node |
| removeListener( String eventName , Function handler , [Object scope ] )
+ NodeRemoves a child node from this node. Removes a child node from this node. | Node |
| removeListener( String eventName , Function handler , [Object scope ] )
:
voidRemoves an event handler. Removes an event handler. | Observable |
| replaceChild( Node newChild , Node oldChild )
:
@@ -195,7 +229,7 @@ events fired during event suspension will be sent to any listeners now.Changes the id of this node. Changes the id of this node. Parameters:id : StringThe new id for the node. Returns: | Node |
| sort( Function fn , [Object scope ] )
:
- voidSorts this nodes children using the supplied sort function Sorts this nodes children using the supplied sort function Parameters:fn : Functionscope : Object(optional) Returns: | Node |
| suspendEvents( Boolean queueSuspended )
+ voidSorts this nodes children using the supplied sort function. Sorts this nodes children using the supplied sort function. Parameters:fn : FunctionA function which, when passed two Nodes, returns -1, 0 or 1 depending upon required sort order. scope : Object(optional)The scope (this reference) in which the function is executed. Defaults to the browser window. Returns: | Node |
| suspendEvents( Boolean queueSuspended )
:
voidSuspend the firing of all events. (see resumeEvents) Suspend the firing of all events. (see resumeEvents) Parameters:queueSuspended : BooleanPass as true to queue up suspended events to be fired
after the resumeEvents call instead of discarding all suspended events; Returns: | Observable |
| un( String eventName , Function handler , [Object scope ] )
|