1 <div class="body-wrap">
2 <div class="top-tools">
3 <a class="inner-link" href="#Ext.tree.DefaultSelectionModel-props"><img src="../resources/images/default/s.gif" class="item-icon icon-prop">Properties</a>
4 <a class="inner-link" href="#Ext.tree.DefaultSelectionModel-methods"><img src="../resources/images/default/s.gif" class="item-icon icon-method">Methods</a>
5 <a class="inner-link" href="#Ext.tree.DefaultSelectionModel-events"><img src="../resources/images/default/s.gif" class="item-icon icon-event">Events</a>
6 <a class="inner-link" href="#Ext.tree.DefaultSelectionModel-configs"><img src="../resources/images/default/s.gif" class="item-icon icon-config">Config Options</a>
7 <a class="bookmark" href="../docs/?class=Ext.tree.DefaultSelectionModel"><img src="../resources/images/default/s.gif" class="item-icon icon-fav">Direct Link</a>
9 <div class="inheritance res-block">
10 <pre class="res-block-inner"><a ext:cls="Ext.util.Observable" ext:member="" href="output/Ext.util.Observable.html">Observable</a>
11 <img src="resources/elbow-end.gif"/>DefaultSelectionModel</pre></div>
12 <h1>Class Ext.tree.DefaultSelectionModel</h1>
13 <table cellspacing="0">
14 <tr><td class="label">Package:</td><td class="hd-info">Ext.tree</td></tr>
15 <tr><td class="label">Defined In:</td><td class="hd-info"><a href="../src/TreeSelectionModel.js" target="_blank">TreeSelectionModel.js</a></td></tr>
16 <tr><td class="label">Class:</td><td class="hd-info">DefaultSelectionModel</td></tr>
17 <tr><td class="label">Extends:</td><td class="hd-info"><a ext:cls="Ext.util.Observable" ext:member="" href="output/Ext.util.Observable.html">Observable</a></td></tr>
19 <div class="description">
21 The default single selection for a TreePanel. </div>
23 <div class="hr"></div>
24 <a id="Ext.tree.DefaultSelectionModel-configs"></a>
25 <h2>Config Options</h2>
26 <table cellspacing="0" class="member-table">
28 <th class="sig-header" colspan="2">Config Options</th>
29 <th class="msource-header">Defined By</th>
31 <tr class="config-row inherited expandable">
\r
32 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
34 <a id="Ext.tree.DefaultSelectionModel-listeners"></a>
\r
35 <b>listeners</b> : Object <div class="mdesc">
\r
36 <div class="short">(optional) A config object containing one or more event handlers to be added to this object during initialization. Th...</div>
\r
38 (optional) 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 ext:cls="Ext.util.Observable" ext:member="addListener" href="output/Ext.util.Observable.html#addListener">addListener</a> example for attaching multiple handlers at once. </div>
\r
41 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#listeners" href="output/Ext.util.Observable.html#listeners">Observable</a></td>
\r
44 <a id="Ext.tree.DefaultSelectionModel-props"></a>
45 <h2>Public Properties</h2>
46 <div class="no-members">This class has no public properties.</div> <a id="Ext.tree.DefaultSelectionModel-methods"></a>
47 <h2>Public Methods</h2>
48 <table cellspacing="0" class="member-table">
50 <th class="sig-header" colspan="2">Method</th>
51 <th class="msource-header">Defined By</th>
53 <tr class="method-row inherited expandable">
\r
54 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
56 <a id="Ext.tree.DefaultSelectionModel-addEvents"></a>
\r
57 <b>addEvents</b>( <code>Object object</code> ) : void <div class="mdesc">
\r
58 <div class="short">Used to define events on this Observable</div>
\r
60 Used to define events on this Observable <div class="mdetail-params">
\r
61 <strong>Parameters:</strong>
\r
62 <ul><li><code>object</code> : Object<div class="sub-desc">The object with the events defined</div></li> </ul>
\r
63 <strong>Returns:</strong>
\r
65 <li><code>void</code></li>
\r
71 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#addEvents" href="output/Ext.util.Observable.html#addEvents">Observable</a></td>
\r
73 <tr class="method-row inherited alt expandable">
\r
74 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
76 <a id="Ext.tree.DefaultSelectionModel-addListener"></a>
\r
77 <b>addListener</b>( <code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span>, <span class="optional" title="Optional">[<code>Object options</code>]</span> ) : void <div class="mdesc">
\r
78 <div class="short">Appends an event handler to this component</div>
\r
80 Appends an event handler to this component <div class="mdetail-params">
\r
81 <strong>Parameters:</strong>
\r
82 <ul><li><code>eventName</code> : String<div class="sub-desc">The type of event to listen for</div></li><li><code>handler</code> : Function<div class="sub-desc">The method the event invokes</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope in which to execute the handler
83 function. The handler function's "this" context.</div></li><li><code>options</code> : Object<div class="sub-desc">(optional) An object containing handler configuration
84 properties. This may contain any of the following properties:<ul>
85 <li><b>scope</b> : Object<p class="sub-desc">The scope in which to execute the handler function. The handler function's "this" context.</p></li>
86 <li><b>delay</b> : Number<p class="sub-desc">The number of milliseconds to delay the invocation of the handler after the event fires.</p></li>
87 <li><b>single</b> : Boolean<p class="sub-desc">True to add a handler to handle just the next firing of the event, and then remove itself.</p></li>
88 <li><b>buffer</b> : Number<p class="sub-desc">Causes the handler to be scheduled to run in an <a ext:cls="Ext.util.DelayedTask" href="output/Ext.util.DelayedTask.html">Ext.util.DelayedTask</a> delayed
89 by the specified number of milliseconds. If the event fires again within that time, the original
90 handler is <em>not</em> invoked, but the new handler is scheduled in its place.</p></li>
93 <b>Combining Options</b><br>
94 Using the options argument, it is possible to combine different types of listeners:<br>
96 A normalized, delayed, one-time listener that auto stops the event and passes a custom argument (forumId)
97 <pre><code>el.on(<em>'click'</em>, <b>this</b>.onClick, <b>this</b>, {
103 <b>Attaching multiple handlers in 1 call</b><br>
104 The method also allows for a single argument to be passed which is a config object containing properties
105 which specify multiple handlers.
109 fn: <b>this</b>.onClick,
113 <em>'mouseover'</em> : {
114 fn: <b>this</b>.onMouseOver,
117 <em>'mouseout'</em> : {
118 fn: <b>this</b>.onMouseOut,
123 Or a shorthand syntax:<br>
125 <em>'click'</em> : <b>this</b>.onClick,
126 <em>'mouseover'</em> : <b>this</b>.onMouseOver,
127 <em>'mouseout'</em> : <b>this</b>.onMouseOut,
129 });</code></pre></div></li> </ul>
\r
130 <strong>Returns:</strong>
\r
132 <li><code>void</code></li>
\r
138 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#addListener" href="output/Ext.util.Observable.html#addListener">Observable</a></td>
\r
140 <tr class="method-row expandable">
\r
141 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
143 <a id="Ext.tree.DefaultSelectionModel-clearSelections"></a>
\r
144 <b>clearSelections</b>() : void <div class="mdesc">
\r
145 <div class="short">Clear all selections</div>
\r
147 Clear all selections <div class="mdetail-params">
\r
148 <strong>Parameters:</strong>
\r
149 <ul><li>None.</li> </ul>
\r
150 <strong>Returns:</strong>
\r
152 <li><code>void</code></li>
\r
158 <td class="msource">DefaultSelectionModel</td>
\r
160 <tr class="method-row inherited alt expandable">
\r
161 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
163 <a id="Ext.tree.DefaultSelectionModel-fireEvent"></a>
\r
164 <b>fireEvent</b>( <code>String eventName</code>, <code>Object... args</code> ) : Boolean <div class="mdesc">
\r
165 <div class="short">Fires the specified event with the passed parameters (minus the event name).</div>
\r
167 Fires the specified event with the passed parameters (minus the event name). <div class="mdetail-params">
\r
168 <strong>Parameters:</strong>
\r
169 <ul><li><code>eventName</code> : String<div class="sub-desc"></div></li><li><code>args</code> : Object...<div class="sub-desc">Variable number of parameters are passed to handlers</div></li> </ul>
\r
170 <strong>Returns:</strong>
\r
172 <li><code>Boolean</code><div class="sub-desc">returns false if any of the handlers return false otherwise it returns true</div></li>
\r
178 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#fireEvent" href="output/Ext.util.Observable.html#fireEvent">Observable</a></td>
\r
180 <tr class="method-row expandable">
\r
181 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
183 <a id="Ext.tree.DefaultSelectionModel-getSelectedNode"></a>
\r
184 <b>getSelectedNode</b>() : TreeNode <div class="mdesc">
\r
185 <div class="short">Get the selected node</div>
\r
187 Get the selected node <div class="mdetail-params">
\r
188 <strong>Parameters:</strong>
\r
189 <ul><li>None.</li> </ul>
\r
190 <strong>Returns:</strong>
\r
192 <li><code>TreeNode</code><div class="sub-desc">The selected node</div></li>
\r
198 <td class="msource">DefaultSelectionModel</td>
\r
200 <tr class="method-row inherited alt expandable">
\r
201 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
203 <a id="Ext.tree.DefaultSelectionModel-hasListener"></a>
\r
204 <b>hasListener</b>( <code>String eventName</code> ) : Boolean <div class="mdesc">
\r
205 <div class="short">Checks to see if this object has any listeners for a specified event</div>
\r
207 Checks to see if this object has any listeners for a specified event <div class="mdetail-params">
\r
208 <strong>Parameters:</strong>
\r
209 <ul><li><code>eventName</code> : String<div class="sub-desc">The name of the event to check for</div></li> </ul>
\r
210 <strong>Returns:</strong>
\r
212 <li><code>Boolean</code><div class="sub-desc">True if the event is being listened for, else false</div></li>
\r
218 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#hasListener" href="output/Ext.util.Observable.html#hasListener">Observable</a></td>
\r
220 <tr class="method-row expandable">
\r
221 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
223 <a id="Ext.tree.DefaultSelectionModel-isSelected"></a>
\r
224 <b>isSelected</b>( <code>TreeNode node</code> ) : Boolean <div class="mdesc">
\r
225 <div class="short">Returns true if the node is selected</div>
\r
227 Returns true if the node is selected <div class="mdetail-params">
\r
228 <strong>Parameters:</strong>
\r
229 <ul><li><code>node</code> : TreeNode<div class="sub-desc">The node to check</div></li> </ul>
\r
230 <strong>Returns:</strong>
\r
232 <li><code>Boolean</code></li>
\r
238 <td class="msource">DefaultSelectionModel</td>
\r
240 <tr class="method-row inherited alt expandable">
\r
241 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
243 <a id="Ext.tree.DefaultSelectionModel-on"></a>
\r
244 <b>on</b>( <code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span>, <span class="optional" title="Optional">[<code>Object options</code>]</span> ) : void <div class="mdesc">
\r
245 <div class="short">Appends an event handler to this element (shorthand for addListener)</div>
\r
247 Appends an event handler to this element (shorthand for addListener) <div class="mdetail-params">
\r
248 <strong>Parameters:</strong>
\r
249 <ul><li><code>eventName</code> : String<div class="sub-desc">The type of event to listen for</div></li><li><code>handler</code> : Function<div class="sub-desc">The method the event invokes</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope in which to execute the handler
250 function. The handler function's "this" context.</div></li><li><code>options</code> : Object<div class="sub-desc">(optional)</div></li> </ul>
\r
251 <strong>Returns:</strong>
\r
253 <li><code>void</code></li>
\r
259 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#on" href="output/Ext.util.Observable.html#on">Observable</a></td>
\r
261 <tr class="method-row inherited expandable">
\r
262 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
264 <a id="Ext.tree.DefaultSelectionModel-purgeListeners"></a>
\r
265 <b>purgeListeners</b>() : void <div class="mdesc">
\r
266 <div class="short">Removes all listeners for this object</div>
\r
268 Removes all listeners for this object <div class="mdetail-params">
\r
269 <strong>Parameters:</strong>
\r
270 <ul><li>None.</li> </ul>
\r
271 <strong>Returns:</strong>
\r
273 <li><code>void</code></li>
\r
279 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#purgeListeners" href="output/Ext.util.Observable.html#purgeListeners">Observable</a></td>
\r
281 <tr class="method-row inherited alt expandable">
\r
282 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
284 <a id="Ext.tree.DefaultSelectionModel-relayEvents"></a>
\r
285 <b>relayEvents</b>( <code>Object o</code>, <code>Array events</code> ) : void <div class="mdesc">
\r
286 <div class="short">Relays selected events from the specified Observable as if the events were fired by <tt><b>this</b></tt>.</div>
\r
288 Relays selected events from the specified Observable as if the events were fired by <tt><b>this</b></tt>. <div class="mdetail-params">
\r
289 <strong>Parameters:</strong>
\r
290 <ul><li><code>o</code> : Object<div class="sub-desc">The Observable whose events this object is to relay.</div></li><li><code>events</code> : Array<div class="sub-desc">Array of event names to relay.</div></li> </ul>
\r
291 <strong>Returns:</strong>
\r
293 <li><code>void</code></li>
\r
299 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#relayEvents" href="output/Ext.util.Observable.html#relayEvents">Observable</a></td>
\r
301 <tr class="method-row inherited expandable">
\r
302 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
304 <a id="Ext.tree.DefaultSelectionModel-removeListener"></a>
\r
305 <b>removeListener</b>( <code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span> ) : void <div class="mdesc">
\r
306 <div class="short">Removes a listener</div>
\r
308 Removes a listener <div class="mdetail-params">
\r
309 <strong>Parameters:</strong>
\r
310 <ul><li><code>eventName</code> : String<div class="sub-desc">The type of event to listen for</div></li><li><code>handler</code> : Function<div class="sub-desc">The handler to remove</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope (this object) for the handler</div></li> </ul>
\r
311 <strong>Returns:</strong>
\r
313 <li><code>void</code></li>
\r
319 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#removeListener" href="output/Ext.util.Observable.html#removeListener">Observable</a></td>
\r
321 <tr class="method-row inherited alt expandable">
\r
322 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
324 <a id="Ext.tree.DefaultSelectionModel-resumeEvents"></a>
\r
325 <b>resumeEvents</b>() : void <div class="mdesc">
\r
326 <div class="short">Resume firing events. (see <a ext:cls="Ext.util.Observable" ext:member="suspendEvents" href="output/Ext.util.Observable.html#suspendEvents">suspendEvents</a>)</div>
\r
328 Resume firing events. (see <a ext:cls="Ext.util.Observable" ext:member="suspendEvents" href="output/Ext.util.Observable.html#suspendEvents">suspendEvents</a>) <div class="mdetail-params">
\r
329 <strong>Parameters:</strong>
\r
330 <ul><li>None.</li> </ul>
\r
331 <strong>Returns:</strong>
\r
333 <li><code>void</code></li>
\r
339 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#resumeEvents" href="output/Ext.util.Observable.html#resumeEvents">Observable</a></td>
\r
341 <tr class="method-row expandable">
\r
342 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
344 <a id="Ext.tree.DefaultSelectionModel-select"></a>
\r
345 <b>select</b>( <code>TreeNode node</code> ) : TreeNode <div class="mdesc">
\r
346 <div class="short">Select a node.</div>
\r
348 Select a node. <div class="mdetail-params">
\r
349 <strong>Parameters:</strong>
\r
350 <ul><li><code>node</code> : TreeNode<div class="sub-desc">The node to select</div></li> </ul>
\r
351 <strong>Returns:</strong>
\r
353 <li><code>TreeNode</code><div class="sub-desc">The selected node</div></li>
\r
359 <td class="msource">DefaultSelectionModel</td>
\r
361 <tr class="method-row alt expandable">
\r
362 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
364 <a id="Ext.tree.DefaultSelectionModel-selectNext"></a>
\r
365 <b>selectNext</b>() : TreeNode <div class="mdesc">
\r
366 <div class="short">Selects the node above the selected node in the tree, intelligently walking the nodes</div>
\r
368 Selects the node above the selected node in the tree, intelligently walking the nodes <div class="mdetail-params">
\r
369 <strong>Parameters:</strong>
\r
370 <ul><li>None.</li> </ul>
\r
371 <strong>Returns:</strong>
\r
373 <li><code>TreeNode</code><div class="sub-desc">The new selection</div></li>
\r
379 <td class="msource">DefaultSelectionModel</td>
\r
381 <tr class="method-row expandable">
\r
382 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
384 <a id="Ext.tree.DefaultSelectionModel-selectPrevious"></a>
\r
385 <b>selectPrevious</b>() : TreeNode <div class="mdesc">
\r
386 <div class="short">Selects the node above the selected node in the tree, intelligently walking the nodes</div>
\r
388 Selects the node above the selected node in the tree, intelligently walking the nodes <div class="mdetail-params">
\r
389 <strong>Parameters:</strong>
\r
390 <ul><li>None.</li> </ul>
\r
391 <strong>Returns:</strong>
\r
393 <li><code>TreeNode</code><div class="sub-desc">The new selection</div></li>
\r
399 <td class="msource">DefaultSelectionModel</td>
\r
401 <tr class="method-row inherited alt expandable">
\r
402 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
404 <a id="Ext.tree.DefaultSelectionModel-suspendEvents"></a>
\r
405 <b>suspendEvents</b>() : void <div class="mdesc">
\r
406 <div class="short">Suspend the firing of all events. (see <a ext:cls="Ext.util.Observable" ext:member="resumeEvents" href="output/Ext.util.Observable.html#resumeEvents">resumeEvents</a>)</div>
\r
408 Suspend the firing of all events. (see <a ext:cls="Ext.util.Observable" ext:member="resumeEvents" href="output/Ext.util.Observable.html#resumeEvents">resumeEvents</a>) <div class="mdetail-params">
\r
409 <strong>Parameters:</strong>
\r
410 <ul><li>None.</li> </ul>
\r
411 <strong>Returns:</strong>
\r
413 <li><code>void</code></li>
\r
419 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#suspendEvents" href="output/Ext.util.Observable.html#suspendEvents">Observable</a></td>
\r
421 <tr class="method-row inherited expandable">
\r
422 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
424 <a id="Ext.tree.DefaultSelectionModel-un"></a>
\r
425 <b>un</b>( <code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span> ) : void <div class="mdesc">
\r
426 <div class="short">Removes a listener (shorthand for removeListener)</div>
\r
428 Removes a listener (shorthand for removeListener) <div class="mdetail-params">
\r
429 <strong>Parameters:</strong>
\r
430 <ul><li><code>eventName</code> : String<div class="sub-desc">The type of event to listen for</div></li><li><code>handler</code> : Function<div class="sub-desc">The handler to remove</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope (this object) for the handler</div></li> </ul>
\r
431 <strong>Returns:</strong>
\r
433 <li><code>void</code></li>
\r
439 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#un" href="output/Ext.util.Observable.html#un">Observable</a></td>
\r
441 <tr class="method-row alt expandable">
\r
442 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
444 <a id="Ext.tree.DefaultSelectionModel-unselect"></a>
\r
445 <b>unselect</b>( <code>TreeNode node</code> ) : void <div class="mdesc">
\r
446 <div class="short">Deselect a node.</div>
\r
448 Deselect a node. <div class="mdetail-params">
\r
449 <strong>Parameters:</strong>
\r
450 <ul><li><code>node</code> : TreeNode<div class="sub-desc">The node to unselect</div></li> </ul>
\r
451 <strong>Returns:</strong>
\r
453 <li><code>void</code></li>
\r
459 <td class="msource">DefaultSelectionModel</td>
\r
462 <a id="Ext.tree.DefaultSelectionModel-events"></a>
463 <h2>Public Events</h2>
464 <table cellspacing="0" class="member-table">
466 <th class="sig-header" colspan="2">Event</th>
467 <th class="msource-header">Defined By</th>
469 <tr class="event-row expandable">
\r
470 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
472 <a id="Ext.tree.DefaultSelectionModel-beforeselect"></a>
\r
473 <b>beforeselect</b> : ( <code>DefaultSelectionModel this</code>, <code>TreeNode node</code>, <code>TreeNode node</code> ) <div class="mdesc">
\r
474 <div class="short">Fires before the selected node changes, return false to cancel the change</div>
\r
476 Fires before the selected node changes, return false to cancel the change <div class="mdetail-params">
\r
477 <strong style="font-weight:normal;">Listeners will be called with the following arguments:</strong>
\r
478 <ul><li><code>this</code> : DefaultSelectionModel<div class="sub-desc"></div></li><li><code>node</code> : TreeNode<div class="sub-desc">the new selection</div></li><li><code>node</code> : TreeNode<div class="sub-desc">the old selection</div></li> </ul>
\r
483 <td class="msource">DefaultSelectionModel</td>
\r
485 <tr class="event-row alt expandable">
\r
486 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
488 <a id="Ext.tree.DefaultSelectionModel-selectionchange"></a>
\r
489 <b>selectionchange</b> : ( <code>DefaultSelectionModel this</code>, <code>TreeNode node</code> ) <div class="mdesc">
\r
490 <div class="short">Fires when the selected node changes</div>
\r
492 Fires when the selected node changes <div class="mdetail-params">
\r
493 <strong style="font-weight:normal;">Listeners will be called with the following arguments:</strong>
\r
494 <ul><li><code>this</code> : DefaultSelectionModel<div class="sub-desc"></div></li><li><code>node</code> : TreeNode<div class="sub-desc">the new selection</div></li> </ul>
\r
499 <td class="msource">DefaultSelectionModel</td>
\r