-<div xmlns:ext="http://www.extjs.com" class="body-wrap"><div class="inheritance res-block"><pre class="res-block-inner"><a href="output/Ext.util.Observable.html" ext:member="" ext:cls="Ext.util.Observable">Observable</a> <img src="resources/elbow-end.gif">Node</pre></div><h1>Class <a href="source/Tree.html#cls-Ext.data.Node">Ext.data.Node</a></h1><table cellspacing="0"><tr><td class="label">Package:</td><td class="hd-info">Ext.data</td></tr><tr><td class="label">Defined In:</td><td class="hd-info">Tree.js</td></tr><tr><td class="label">Class:</td><td class="hd-info"><a href="source/Tree.html#cls-Ext.data.Node">Node</a></td></tr><tr><td class="label">Subclasses:</td><td class="hd-info"><a href="output/Ext.tree.TreeNode.html" ext:cls="Ext.tree.TreeNode">TreeNode</a></td></tr><tr><td class="label">Extends:</td><td class="hd-info"><a href="output/Ext.util.Observable.html" ext:cls="Ext.util.Observable" ext:member="">Observable</a></td></tr></table><div class="description"></div><div class="hr"></div><a id="Ext.data.Node-configs"></a><h2>Config Options</h2><table cellspacing="0" class="member-table"><tbody><tr><th colspan="2" class="sig-header">Config Options</th><th class="msource-header">Defined By</th></tr><tr class="config-row "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.data.Node-id"></a><b><a href="source/Tree.html#cfg-Ext.data.Node-id">id</a></b> : String<div class="mdesc">The id for this node. If one is not specified, one is generated.</div></td><td class="msource">Node</td></tr><tr class="config-row "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.data.Node-leaf"></a><b><a href="source/Tree.html#cfg-Ext.data.Node-leaf">leaf</a></b> : Boolean<div class="mdesc">true if this node is a leaf and does not have children</div></td><td class="msource">Node</td></tr><tr class="config-row expandable inherited"><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.util.Observable-listeners"></a><b><a href="source/Observable.html#cfg-Ext.util.Observable-listeners">listeners</a></b> : Object<div class="mdesc"><div class="short">A config object containing one or more event handlers to be added to this
+<div class="body-wrap" xmlns:ext="http://www.extjs.com"><div class="top-tools"><a class="inner-link" href="#Ext.data.Node-props"><img src="resources/images/default/s.gif" class="item-icon icon-prop">Properties</a> <a class="inner-link" href="#Ext.data.Node-methods"><img src="resources/images/default/s.gif" class="item-icon icon-method">Methods</a> <a class="inner-link" href="#Ext.data.Node-events"><img src="resources/images/default/s.gif" class="item-icon icon-event">Events</a> <a class="inner-link" href="#Ext.data.Node-configs"><img src="resources/images/default/s.gif" class="item-icon icon-config">Config Options</a> <a class="bookmark" href="../docs/?class=Ext.data.Node"><img src="resources/images/default/s.gif" class="item-icon icon-fav">Direct Link</a> </div><div class="inheritance res-block"><pre class="res-block-inner"><a href="output/Ext.util.Observable.html" ext:member="" ext:cls="Ext.util.Observable">Observable</a>
+ <img src="resources/elbow-end.gif">Node</pre></div><h1>Class <a href="source/Tree.html#cls-Ext.data.Node">Ext.data.Node</a></h1><table cellspacing="0"><tr><td class="label">Package:</td><td class="hd-info">Ext.data</td></tr><tr><td class="label">Defined In:</td><td class="hd-info"><a href="source/Tree.html#cls-Ext.data.Node">Tree.js</a></td></tr><tr><td class="label">Class:</td><td class="hd-info"><a href="source/Tree.html#cls-Ext.data.Node">Node</a></td></tr><tr><td class="label">Subclasses:</td><td class="hd-info"><a href="output/Ext.tree.TreeNode.html" ext:cls="Ext.tree.TreeNode">TreeNode</a></td></tr><tr><td class="label">Extends:</td><td class="hd-info"><a href="output/Ext.util.Observable.html" ext:cls="Ext.util.Observable" ext:member="">Observable</a></td></tr></table><div class="description"></div><div class="hr"></div><a id="Ext.data.Node-configs"></a><h2>Config Options</h2><table cellspacing="0" class="member-table"><tbody><tr><th colspan="2" class="sig-header">Config Options</th><th class="msource-header">Defined By</th></tr><tr class="config-row "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.data.Node-id"></a><b><a href="source/Tree.html#cfg-Ext.data.Node-id">id</a></b> : String<div class="mdesc">The id for this node. If one is not specified, one is generated.</div></td><td class="msource">Node</td></tr><tr class="config-row "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.data.Node-leaf"></a><b><a href="source/Tree.html#cfg-Ext.data.Node-leaf">leaf</a></b> : Boolean<div class="mdesc">true if this node is a leaf and does not have children</div></td><td class="msource">Node</td></tr><tr class="config-row expandable inherited"><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.util.Observable-listeners"></a><b><a href="source/Observable.html#cfg-Ext.util.Observable-listeners">listeners</a></b> : Object<div class="mdesc"><div class="short">A config object containing one or more event handlers to be added to this
object during initialization. This should ...</div><div class="long"><p>A config object containing one or more event handlers to be added to this
object during initialization. This should be a valid listeners config object as specified in the
<a href="output/Ext.util.Observable.html#Ext.util.Observable-addListener" ext:member="addListener" ext:cls="Ext.util.Observable">addListener</a> example for attaching multiple handlers at once.</p>
:
Node<div class="mdesc"><div class="short">Insert node(s) as the last child node of this node.</div><div class="long">Insert node(s) as the last child node of this node.<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>node</code> : Node/Array<div class="sub-desc">The node or Array of nodes to append</div></li></ul><strong>Returns:</strong><ul><li><code>Node</code><div class="sub-desc">The appended node if single append, or null if an array was passed</div></li></ul></div></div></div></td><td class="msource">Node</td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.data.Node-bubble"></a><b><a href="source/Tree.html#method-Ext.data.Node-bubble">bubble</a></b>( <code>Function fn</code>, <span title="Optional" class="optional">[<code>Object scope</code>]</span>, <span title="Optional" class="optional">[<code>Array args</code>]</span> )
:
- void<div class="mdesc"><div class="short">Bubbles up the tree from this node, calling the specified function with each node. The arguments to the function
-wil...</div><div class="long">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
+ void<div class="mdesc"><div class="short">Bubbles up the tree from this node, calling the specified function with each node. The arguments to the function
+will...</div><div class="long">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.<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>fn</code> : Function<div class="sub-desc">The function to call</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope (<code>this</code> reference) in which the function is executed. Defaults to the current Node.</div></li><li><code>args</code> : Array<div class="sub-desc">(optional) The args to call the function with (default to passing the current Node)</div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource">Node</td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.data.Node-cascade"></a><b><a href="source/Tree.html#method-Ext.data.Node-cascade">cascade</a></b>( <code>Function fn</code>, <span title="Optional" class="optional">[<code>Object scope</code>]</span>, <span title="Optional" class="optional">[<code>Array args</code>]</span> )
:
- void<div class="mdesc"><div class="short">Cascades down the tree from this node, calling the specified function with each node. The arguments to the function
-...</div><div class="long">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
+ void<div class="mdesc"><div class="short">Cascades down the tree from this node, calling the specified function with each node. The arguments to the function
+w...</div><div class="long">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.<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>fn</code> : Function<div class="sub-desc">The function to call</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope (<code>this</code> reference) in which the function is executed. Defaults to the current Node.</div></li><li><code>args</code> : Array<div class="sub-desc">(optional) The args to call the function with (default to passing the current Node)</div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource">Node</td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.data.Node-contains"></a><b><a href="source/Tree.html#method-Ext.data.Node-contains">contains</a></b>( <code>Node node</code> )
:
Boolean<div class="mdesc"><div class="short">Returns true if this node is an ancestor (at any point) of the passed node.</div><div class="long">Returns true if this node is an ancestor (at any point) of the passed node.<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>node</code> : Node<div class="sub-desc"></div></li></ul><strong>Returns:</strong><ul><li><code>Boolean</code><div class="sub-desc"></div></li></ul></div></div></div></td><td class="msource">Node</td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.data.Node-destroy"></a><b><a href="source/Tree.html#method-Ext.data.Node-destroy">destroy</a></b>()
:
void<div class="mdesc"><div class="short">Destroys the node.</div><div class="long">Destroys the node.<div class="mdetail-params"><strong>Parameters:</strong><ul><li>None.</li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource">Node</td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.data.Node-eachChild"></a><b><a href="source/Tree.html#method-Ext.data.Node-eachChild">eachChild</a></b>( <code>Function fn</code>, <span title="Optional" class="optional">[<code>Object scope</code>]</span>, <span title="Optional" class="optional">[<code>Array args</code>]</span> )
:
- void<div class="mdesc"><div class="short">Interates the child nodes of this node, calling the specified function with each node. The arguments to the function ...</div><div class="long">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
+ void<div class="mdesc"><div class="short">Interates the child nodes of this node, calling the specified function with each node. The arguments to the function
+...</div><div class="long">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.<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>fn</code> : Function<div class="sub-desc">The function to call</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope (<code>this</code> reference) in which the function is executed. Defaults to the current Node in the iteration.</div></li><li><code>args</code> : Array<div class="sub-desc">(optional) The args to call the function with (default to passing the current Node)</div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource">Node</td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.util.Observable-enableBubble"></a><b><a href="source/Observable-more.html#method-Ext.util.Observable-enableBubble">enableBubble</a></b>( <code>String/Array events</code> )
:
- void<div class="mdesc"><div class="short">Enables events fired by this Observable to bubble up an owner hierarchy by calling
-this.getBubbleTarget() if present...</div><div class="long"><p>Enables events fired by this Observable to bubble up an owner hierarchy by calling\r
-<code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p>\r
-<p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="output/Ext.Component.getBubbleTarget.html" ext:cls="Ext.Component.getBubbleTarget">Ext.Component.getBubbleTarget</a>. The default\r
-implementation in Ext.Component returns the Component's immediate owner. But if a known target is required, this can be overridden to\r
-access the required target more quickly.</p>\r
-<p>Example:</p><pre><code>Ext.override(Ext.form.Field, {\r
- <i>// Add functionality to Field's initComponent to enable the change event to bubble\r</i>
- initComponent : Ext.form.Field.prototype.initComponent.createSequence(<b>function</b>() {\r
- this.enableBubble(<em>'change'</em>);\r
- }),\r
-\r
- <i>// We know that we want Field's events to bubble directly to the FormPanel.\r</i>
- getBubbleTarget : <b>function</b>() {\r
- <b>if</b> (!this.formPanel) {\r
- this.formPanel = this.findParentByType(<em>'form'</em>);\r
- }\r
- <b>return</b> this.formPanel;\r
- }\r
-});\r
-\r
-<b>var</b> myForm = <b>new</b> Ext.formPanel({\r
- title: <em>'User Details'</em>,\r
- items: [{\r
- ...\r
- }],\r
- listeners: {\r
- change: <b>function</b>() {\r
- <i>// Title goes red <b>if</b> form has been modified.\r</i>
- myForm.header.setStyle(<em>'color'</em>, <em>'red'</em>);\r
- }\r
- }\r
-});</code></pre><div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>events</code> : String/Array<div class="sub-desc">The event name to bubble, or an Array of event names.</div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Observable.html#enableBubble" ext:member="#enableBubble" ext:cls="Ext.util.Observable">Observable</a></td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.data.Node-findChild"></a><b><a href="source/Tree.html#method-Ext.data.Node-findChild">findChild</a></b>( <code>String attribute</code>, <code>Mixed value</code> )
- :
- Node<div class="mdesc"><div class="short">Finds the first child that has the attribute with the specified value.</div><div class="long">Finds the first child that has the attribute with the specified value.<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>attribute</code> : String<div class="sub-desc">The attribute name</div></li><li><code>value</code> : Mixed<div class="sub-desc">The value to search for</div></li></ul><strong>Returns:</strong><ul><li><code>Node</code><div class="sub-desc">The found child or null if none was found</div></li></ul></div></div></div></td><td class="msource">Node</td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.data.Node-findChildBy"></a><b><a href="source/Tree.html#method-Ext.data.Node-findChildBy">findChildBy</a></b>( <code>Function fn</code>, <span title="Optional" class="optional">[<code>Object scope</code>]</span> )
- :
- Node<div class="mdesc"><div class="short">Finds the first child by a custom function. The child matches if the function passed returns true.</div><div class="long">Finds the first child by a custom function. The child matches if the function passed returns <code>true</code>.<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>fn</code> : Function<div class="sub-desc">A function which must return <code>true</code> if the passed Node is the required Node.</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope (<code>this</code> reference) in which the function is executed. Defaults to the Node being tested.</div></li></ul><strong>Returns:</strong><ul><li><code>Node</code><div class="sub-desc">The found child or null if none was found</div></li></ul></div></div></div></td><td class="msource">Node</td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.util.Observable-fireEvent"></a><b><a href="source/Observable.html#method-Ext.util.Observable-fireEvent">fireEvent</a></b>( <code>String eventName</code>, <code>Object... args</code> )
+ void<div class="mdesc"><div class="short">Enables events fired by this Observable to bubble up an owner hierarchy by calling
+this.getBubbleTarget() if present....</div><div class="long"><p>Enables events fired by this Observable to bubble up an owner hierarchy by calling
+<code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p>
+<p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="output/Ext.Component.getBubbleTarget.html" ext:cls="Ext.Component.getBubbleTarget">Ext.Component.getBubbleTarget</a>. 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.</p>
+<p>Example:</p><pre><code>Ext.override(Ext.form.Field, {
+ <i>// Add functionality to Field's initComponent to enable the change event to bubble</i>
+ initComponent : Ext.form.Field.prototype.initComponent.createSequence(<b>function</b>() {
+ this.enableBubble(<em>'change'</em>);
+ }),
+
+ <i>// We know that we want Field's events to bubble directly to the FormPanel.</i>
+ getBubbleTarget : <b>function</b>() {
+ <b>if</b> (!this.formPanel) {
+ this.formPanel = this.findParentByType(<em>'form'</em>);
+ }
+ <b>return</b> this.formPanel;
+ }
+});
+
+<b>var</b> myForm = <b>new</b> Ext.formPanel({
+ title: <em>'User Details'</em>,
+ items: [{
+ ...
+ }],
+ listeners: {
+ change: <b>function</b>() {
+ <i>// Title goes red <b>if</b> form has been modified.</i>
+ myForm.header.setStyle(<em>'color'</em>, <em>'red'</em>);
+ }
+ }
+});</code></pre><div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>events</code> : String/Array<div class="sub-desc">The event name to bubble, or an Array of event names.</div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Observable.html#enableBubble" ext:member="#enableBubble" ext:cls="Ext.util.Observable">Observable</a></td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.data.Node-findChild"></a><b><a href="source/Tree.html#method-Ext.data.Node-findChild">findChild</a></b>( <code>String attribute</code>, <code>Mixed value</code>, <span title="Optional" class="optional">[<code>Boolean deep</code>]</span> )
+ :
+ Node<div class="mdesc"><div class="short">Finds the first child that has the attribute with the specified value.</div><div class="long">Finds the first child that has the attribute with the specified value.<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>attribute</code> : String<div class="sub-desc">The attribute name</div></li><li><code>value</code> : Mixed<div class="sub-desc">The value to search for</div></li><li><code>deep</code> : Boolean<div class="sub-desc">(Optional) True to search through nodes deeper than the immediate children</div></li></ul><strong>Returns:</strong><ul><li><code>Node</code><div class="sub-desc">The found child or null if none was found</div></li></ul></div></div></div></td><td class="msource">Node</td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.data.Node-findChildBy"></a><b><a href="source/Tree.html#method-Ext.data.Node-findChildBy">findChildBy</a></b>( <code>Function fn</code>, <span title="Optional" class="optional">[<code>Object scope</code>]</span>, <span title="Optional" class="optional">[<code>Boolean deep</code>]</span> )
+ :
+ Node<div class="mdesc"><div class="short">Finds the first child by a custom function. The child matches if the function passed returns true.</div><div class="long">Finds the first child by a custom function. The child matches if the function passed returns <code>true</code>.<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>fn</code> : Function<div class="sub-desc">A function which must return <code>true</code> if the passed Node is the required Node.</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope (<code>this</code> reference) in which the function is executed. Defaults to the Node being tested.</div></li><li><code>deep</code> : Boolean<div class="sub-desc">(Optional) True to search through nodes deeper than the immediate children</div></li></ul><strong>Returns:</strong><ul><li><code>Node</code><div class="sub-desc">The found child or null if none was found</div></li></ul></div></div></div></td><td class="msource">Node</td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.util.Observable-fireEvent"></a><b><a href="source/Observable.html#method-Ext.util.Observable-fireEvent">fireEvent</a></b>( <code>String eventName</code>, <code>Object... args</code> )
:
Boolean<div class="mdesc"><div class="short">Fires the specified event with the passed parameters (minus the event name).
An event may be set to bubble up an Obse...</div><div class="long"><p>Fires the specified event with the passed parameters (minus the event name).</p>
:
Boolean<div class="mdesc"><div class="short">Returns true if the passed node is an ancestor (at any point) of this node.</div><div class="long">Returns true if the passed node is an ancestor (at any point) of this node.<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>node</code> : Node<div class="sub-desc"></div></li></ul><strong>Returns:</strong><ul><li><code>Boolean</code><div class="sub-desc"></div></li></ul></div></div></div></td><td class="msource">Node</td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.data.Node-isExpandable"></a><b><a href="source/Tree.html#method-Ext.data.Node-isExpandable">isExpandable</a></b>()
:
- Boolean<div class="mdesc"><div class="short">Returns true if this node has one or more child nodes, or if the expandable
-node attribute is explicitly specified a...</div><div class="long">Returns true if this node has one or more child nodes, or if the <tt>expandable</tt>\r
+ Boolean<div class="mdesc"><div class="short">Returns true if this node has one or more child nodes, or if the expandable
+node attribute is explicitly specified as...</div><div class="long">Returns true if this node has one or more child nodes, or if the <tt>expandable</tt>
node attribute is explicitly specified as true (see <a href="output/Ext.data.Node.html#Ext.data.Node-attributes" ext:member="attributes" ext:cls="Ext.data.Node">attributes</a>), otherwise returns false.<div class="mdetail-params"><strong>Parameters:</strong><ul><li>None.</li></ul><strong>Returns:</strong><ul><li><code>Boolean</code><div class="sub-desc"></div></li></ul></div></div></div></td><td class="msource">Node</td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.data.Node-isFirst"></a><b><a href="source/Tree.html#method-Ext.data.Node-isFirst">isFirst</a></b>()
:
Boolean<div class="mdesc"><div class="short">Returns true if this node is the first child of its parent</div><div class="long">Returns true if this node is the first child of its parent<div class="mdetail-params"><strong>Parameters:</strong><ul><li>None.</li></ul><strong>Returns:</strong><ul><li><code>Boolean</code><div class="sub-desc"></div></li></ul></div></div></div></td><td class="msource">Node</td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.data.Node-isLast"></a><b><a href="source/Tree.html#method-Ext.data.Node-isLast">isLast</a></b>()