1 | <div class="body-wrap"> |
---|
2 | <div class="top-tools"> |
---|
3 | <a class="inner-link" href="#Ext.util.MixedCollection-props"><img src="../resources/images/default/s.gif" class="item-icon icon-prop">Properties</a> |
---|
4 | <a class="inner-link" href="#Ext.util.MixedCollection-methods"><img src="../resources/images/default/s.gif" class="item-icon icon-method">Methods</a> |
---|
5 | <a class="inner-link" href="#Ext.util.MixedCollection-events"><img src="../resources/images/default/s.gif" class="item-icon icon-event">Events</a> |
---|
6 | <a class="inner-link" href="#Ext.util.MixedCollection-configs"><img src="../resources/images/default/s.gif" class="item-icon icon-config">Config Options</a> |
---|
7 | <a class="bookmark" href="../docs/?class=Ext.util.MixedCollection"><img src="../resources/images/default/s.gif" class="item-icon icon-fav">Direct Link</a> |
---|
8 | </div> |
---|
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"/>MixedCollection</pre></div> |
---|
12 | <h1>Class Ext.util.MixedCollection</h1> |
---|
13 | <table cellspacing="0"> |
---|
14 | <tr><td class="label">Package:</td><td class="hd-info">Ext.util</td></tr> |
---|
15 | <tr><td class="label">Defined In:</td><td class="hd-info"><a href="../src/MixedCollection.js" target="_blank">MixedCollection.js</a></td></tr> |
---|
16 | <tr><td class="label">Class:</td><td class="hd-info">MixedCollection</td></tr> |
---|
17 | <tr><td class="label">Subclasses:</td><td class="hd-info"><a ext:cls="Ext.StoreMgr" href="output/Ext.StoreMgr.html">StoreMgr</a></td></tr> |
---|
18 | <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 | </table> |
---|
20 | <div class="description"> |
---|
21 | * |
---|
22 | A Collection class that maintains both numeric indexes and keys and exposes events. </div> |
---|
23 | |
---|
24 | <div class="hr"></div> |
---|
25 | <a id="Ext.util.MixedCollection-configs"></a> |
---|
26 | <h2>Config Options</h2> |
---|
27 | <table cellspacing="0" class="member-table"> |
---|
28 | <tr> |
---|
29 | <th class="sig-header" colspan="2">Config Options</th> |
---|
30 | <th class="msource-header">Defined By</th> |
---|
31 | </tr> |
---|
32 | <tr class="config-row inherited expandable"> |
---|
33 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
34 | <td class="sig"> |
---|
35 | <a id="Ext.util.MixedCollection-listeners"></a> |
---|
36 | <b>listeners</b> : Object <div class="mdesc"> |
---|
37 | <div class="short">(optional) A config object containing one or more event handlers to be added to this object during initialization. Th...</div> |
---|
38 | <div class="long"> |
---|
39 | (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> |
---|
40 | </div> |
---|
41 | </td> |
---|
42 | <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#listeners" href="output/Ext.util.Observable.html#listeners">Observable</a></td> |
---|
43 | </tr> |
---|
44 | </table> |
---|
45 | <a id="Ext.util.MixedCollection-props"></a> |
---|
46 | <h2>Public Properties</h2> |
---|
47 | <div class="no-members">This class has no public properties.</div> <a id="Ext.util.MixedCollection-methods"></a> |
---|
48 | <h2>Public Methods</h2> |
---|
49 | <table cellspacing="0" class="member-table"> |
---|
50 | <tr> |
---|
51 | <th class="sig-header" colspan="2">Method</th> |
---|
52 | <th class="msource-header">Defined By</th> |
---|
53 | </tr> |
---|
54 | <tr class="method-row expandable"> |
---|
55 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
56 | <td class="sig"> |
---|
57 | <a id="Ext.util.MixedCollection-MixedCollection"></a> |
---|
58 | <b>MixedCollection</b>( <code>Boolean allowFunctions</code>, <code>Function keyFn</code> ) <div class="mdesc"> |
---|
59 | <div class="short"></div> |
---|
60 | <div class="long"> |
---|
61 | <div class="mdetail-params"> |
---|
62 | <strong>Parameters:</strong> |
---|
63 | <ul><li><code>allowFunctions</code> : Boolean<div class="sub-desc">True if the addAll function should add function references to the |
---|
64 | collection (defaults to false)</div></li><li><code>keyFn</code> : Function<div class="sub-desc">A function that can accept an item of the type(s) stored in this MixedCollection |
---|
65 | and return the key value for that item. This is used when available to look up the key on items that |
---|
66 | were passed without an explicit key parameter to a MixedCollection method. Passing this parameter is |
---|
67 | equivalent to providing an implementation for the <a ext:cls="Ext.util.MixedCollection" ext:member="getKey" href="output/Ext.util.MixedCollection.html#getKey">getKey</a> method.</div></li> </ul> |
---|
68 | <strong>Returns:</strong> |
---|
69 | <ul> |
---|
70 | <li><code></code></li> |
---|
71 | </ul> |
---|
72 | </div> |
---|
73 | </div> |
---|
74 | </div> |
---|
75 | </td> |
---|
76 | <td class="msource">MixedCollection</td> |
---|
77 | </tr> |
---|
78 | <tr class="method-row alt expandable"> |
---|
79 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
80 | <td class="sig"> |
---|
81 | <a id="Ext.util.MixedCollection-add"></a> |
---|
82 | <b>add</b>( <code>String key</code>, <code>Object o</code> ) : Object <div class="mdesc"> |
---|
83 | <div class="short">Adds an item to the collection. Fires the <a ext:cls="Ext.util.MixedCollection" ext:member="add" href="output/Ext.util.MixedCollection.html#add">add</a> event when complete.</div> |
---|
84 | <div class="long"> |
---|
85 | Adds an item to the collection. Fires the <a ext:cls="Ext.util.MixedCollection" ext:member="add" href="output/Ext.util.MixedCollection.html#add">add</a> event when complete. <div class="mdetail-params"> |
---|
86 | <strong>Parameters:</strong> |
---|
87 | <ul><li><code>key</code> : String<div class="sub-desc"><p>The key to associate with the item, or the new item.</p> |
---|
88 | <p>If you supplied a <a ext:cls="Ext.util.MixedCollection" ext:member="getKey" href="output/Ext.util.MixedCollection.html#getKey">getKey</a> implementation for this MixedCollection, or if the key |
---|
89 | of your stored items is in a property called <tt><b>id</b></tt>, then the MixedCollection |
---|
90 | will be able to <i>derive</i> the key for the new item. In this case just pass the new item in |
---|
91 | this parameter.</p></div></li><li><code>o</code> : Object<div class="sub-desc">The item to add.</div></li> </ul> |
---|
92 | <strong>Returns:</strong> |
---|
93 | <ul> |
---|
94 | <li><code>Object</code><div class="sub-desc">The item added.</div></li> |
---|
95 | </ul> |
---|
96 | </div> |
---|
97 | </div> |
---|
98 | </div> |
---|
99 | </td> |
---|
100 | <td class="msource">MixedCollection</td> |
---|
101 | </tr> |
---|
102 | <tr class="method-row expandable"> |
---|
103 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
104 | <td class="sig"> |
---|
105 | <a id="Ext.util.MixedCollection-addAll"></a> |
---|
106 | <b>addAll</b>( <code>Object/Array objs</code> ) : void <div class="mdesc"> |
---|
107 | <div class="short">Adds all elements of an Array or an Object to the collection.</div> |
---|
108 | <div class="long"> |
---|
109 | Adds all elements of an Array or an Object to the collection. <div class="mdetail-params"> |
---|
110 | <strong>Parameters:</strong> |
---|
111 | <ul><li><code>objs</code> : Object/Array<div class="sub-desc">An Object containing properties which will be added to the collection, or |
---|
112 | an Array of values, each of which are added to the collection.</div></li> </ul> |
---|
113 | <strong>Returns:</strong> |
---|
114 | <ul> |
---|
115 | <li><code>void</code></li> |
---|
116 | </ul> |
---|
117 | </div> |
---|
118 | </div> |
---|
119 | </div> |
---|
120 | </td> |
---|
121 | <td class="msource">MixedCollection</td> |
---|
122 | </tr> |
---|
123 | <tr class="method-row inherited alt expandable"> |
---|
124 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
125 | <td class="sig"> |
---|
126 | <a id="Ext.util.MixedCollection-addEvents"></a> |
---|
127 | <b>addEvents</b>( <code>Object object</code> ) : void <div class="mdesc"> |
---|
128 | <div class="short">Used to define events on this Observable</div> |
---|
129 | <div class="long"> |
---|
130 | Used to define events on this Observable <div class="mdetail-params"> |
---|
131 | <strong>Parameters:</strong> |
---|
132 | <ul><li><code>object</code> : Object<div class="sub-desc">The object with the events defined</div></li> </ul> |
---|
133 | <strong>Returns:</strong> |
---|
134 | <ul> |
---|
135 | <li><code>void</code></li> |
---|
136 | </ul> |
---|
137 | </div> |
---|
138 | </div> |
---|
139 | </div> |
---|
140 | </td> |
---|
141 | <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#addEvents" href="output/Ext.util.Observable.html#addEvents">Observable</a></td> |
---|
142 | </tr> |
---|
143 | <tr class="method-row inherited expandable"> |
---|
144 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
145 | <td class="sig"> |
---|
146 | <a id="Ext.util.MixedCollection-addListener"></a> |
---|
147 | <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"> |
---|
148 | <div class="short">Appends an event handler to this component</div> |
---|
149 | <div class="long"> |
---|
150 | Appends an event handler to this component <div class="mdetail-params"> |
---|
151 | <strong>Parameters:</strong> |
---|
152 | <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 |
---|
153 | function. The handler function's "this" context.</div></li><li><code>options</code> : Object<div class="sub-desc">(optional) An object containing handler configuration |
---|
154 | properties. This may contain any of the following properties:<ul> |
---|
155 | <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> |
---|
156 | <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> |
---|
157 | <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> |
---|
158 | <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 |
---|
159 | by the specified number of milliseconds. If the event fires again within that time, the original |
---|
160 | handler is <em>not</em> invoked, but the new handler is scheduled in its place.</p></li> |
---|
161 | </ul><br> |
---|
162 | <p> |
---|
163 | <b>Combining Options</b><br> |
---|
164 | Using the options argument, it is possible to combine different types of listeners:<br> |
---|
165 | <br> |
---|
166 | A normalized, delayed, one-time listener that auto stops the event and passes a custom argument (forumId) |
---|
167 | <pre><code>el.on(<em>'click'</em>, <b>this</b>.onClick, <b>this</b>, { |
---|
168 | single: true, |
---|
169 | delay: 100, |
---|
170 | forumId: 4 |
---|
171 | });</code></pre> |
---|
172 | <p> |
---|
173 | <b>Attaching multiple handlers in 1 call</b><br> |
---|
174 | The method also allows for a single argument to be passed which is a config object containing properties |
---|
175 | which specify multiple handlers. |
---|
176 | <p> |
---|
177 | <pre><code>foo.on({ |
---|
178 | <em>'click'</em> : { |
---|
179 | fn: <b>this</b>.onClick, |
---|
180 | scope: <b>this</b>, |
---|
181 | delay: 100 |
---|
182 | }, |
---|
183 | <em>'mouseover'</em> : { |
---|
184 | fn: <b>this</b>.onMouseOver, |
---|
185 | scope: <b>this</b> |
---|
186 | }, |
---|
187 | <em>'mouseout'</em> : { |
---|
188 | fn: <b>this</b>.onMouseOut, |
---|
189 | scope: <b>this</b> |
---|
190 | } |
---|
191 | });</code></pre> |
---|
192 | <p> |
---|
193 | Or a shorthand syntax:<br> |
---|
194 | <pre><code>foo.on({ |
---|
195 | <em>'click'</em> : <b>this</b>.onClick, |
---|
196 | <em>'mouseover'</em> : <b>this</b>.onMouseOver, |
---|
197 | <em>'mouseout'</em> : <b>this</b>.onMouseOut, |
---|
198 | scope: <b>this</b> |
---|
199 | });</code></pre></div></li> </ul> |
---|
200 | <strong>Returns:</strong> |
---|
201 | <ul> |
---|
202 | <li><code>void</code></li> |
---|
203 | </ul> |
---|
204 | </div> |
---|
205 | </div> |
---|
206 | </div> |
---|
207 | </td> |
---|
208 | <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#addListener" href="output/Ext.util.Observable.html#addListener">Observable</a></td> |
---|
209 | </tr> |
---|
210 | <tr class="method-row alt expandable"> |
---|
211 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
212 | <td class="sig"> |
---|
213 | <a id="Ext.util.MixedCollection-clear"></a> |
---|
214 | <b>clear</b>() : void <div class="mdesc"> |
---|
215 | <div class="short">Removes all items from the collection. Fires the <a ext:cls="Ext.util.MixedCollection" ext:member="clear" href="output/Ext.util.MixedCollection.html#clear">clear</a> event when complete.</div> |
---|
216 | <div class="long"> |
---|
217 | Removes all items from the collection. Fires the <a ext:cls="Ext.util.MixedCollection" ext:member="clear" href="output/Ext.util.MixedCollection.html#clear">clear</a> event when complete. <div class="mdetail-params"> |
---|
218 | <strong>Parameters:</strong> |
---|
219 | <ul><li>None.</li> </ul> |
---|
220 | <strong>Returns:</strong> |
---|
221 | <ul> |
---|
222 | <li><code>void</code></li> |
---|
223 | </ul> |
---|
224 | </div> |
---|
225 | </div> |
---|
226 | </div> |
---|
227 | </td> |
---|
228 | <td class="msource">MixedCollection</td> |
---|
229 | </tr> |
---|
230 | <tr class="method-row expandable"> |
---|
231 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
232 | <td class="sig"> |
---|
233 | <a id="Ext.util.MixedCollection-clone"></a> |
---|
234 | <b>clone</b>() : MixedCollection <div class="mdesc"> |
---|
235 | <div class="short">Creates a shallow copy of this collection</div> |
---|
236 | <div class="long"> |
---|
237 | Creates a shallow copy of this collection <div class="mdetail-params"> |
---|
238 | <strong>Parameters:</strong> |
---|
239 | <ul><li>None.</li> </ul> |
---|
240 | <strong>Returns:</strong> |
---|
241 | <ul> |
---|
242 | <li><code>MixedCollection</code></li> |
---|
243 | </ul> |
---|
244 | </div> |
---|
245 | </div> |
---|
246 | </div> |
---|
247 | </td> |
---|
248 | <td class="msource">MixedCollection</td> |
---|
249 | </tr> |
---|
250 | <tr class="method-row alt expandable"> |
---|
251 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
252 | <td class="sig"> |
---|
253 | <a id="Ext.util.MixedCollection-contains"></a> |
---|
254 | <b>contains</b>( <code>Object o</code> ) : Boolean <div class="mdesc"> |
---|
255 | <div class="short">Returns true if the collection contains the passed Object as an item.</div> |
---|
256 | <div class="long"> |
---|
257 | Returns true if the collection contains the passed Object as an item. <div class="mdetail-params"> |
---|
258 | <strong>Parameters:</strong> |
---|
259 | <ul><li><code>o</code> : Object<div class="sub-desc">The Object to look for in the collection.</div></li> </ul> |
---|
260 | <strong>Returns:</strong> |
---|
261 | <ul> |
---|
262 | <li><code>Boolean</code><div class="sub-desc">True if the collection contains the Object as an item.</div></li> |
---|
263 | </ul> |
---|
264 | </div> |
---|
265 | </div> |
---|
266 | </div> |
---|
267 | </td> |
---|
268 | <td class="msource">MixedCollection</td> |
---|
269 | </tr> |
---|
270 | <tr class="method-row expandable"> |
---|
271 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
272 | <td class="sig"> |
---|
273 | <a id="Ext.util.MixedCollection-containsKey"></a> |
---|
274 | <b>containsKey</b>( <code>String key</code> ) : Boolean <div class="mdesc"> |
---|
275 | <div class="short">Returns true if the collection contains the passed Object as a key.</div> |
---|
276 | <div class="long"> |
---|
277 | Returns true if the collection contains the passed Object as a key. <div class="mdetail-params"> |
---|
278 | <strong>Parameters:</strong> |
---|
279 | <ul><li><code>key</code> : String<div class="sub-desc">The key to look for in the collection.</div></li> </ul> |
---|
280 | <strong>Returns:</strong> |
---|
281 | <ul> |
---|
282 | <li><code>Boolean</code><div class="sub-desc">True if the collection contains the Object as a key.</div></li> |
---|
283 | </ul> |
---|
284 | </div> |
---|
285 | </div> |
---|
286 | </div> |
---|
287 | </td> |
---|
288 | <td class="msource">MixedCollection</td> |
---|
289 | </tr> |
---|
290 | <tr class="method-row alt expandable"> |
---|
291 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
292 | <td class="sig"> |
---|
293 | <a id="Ext.util.MixedCollection-each"></a> |
---|
294 | <b>each</b>( <code>Function fn</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span> ) : void <div class="mdesc"> |
---|
295 | <div class="short">Executes the specified function once for every item in the collection, passing the following arguments: |
---|
296 | |
---|
297 | item : Mixed...</div> |
---|
298 | <div class="long"> |
---|
299 | Executes the specified function once for every item in the collection, passing the following arguments: |
---|
300 | <div class="mdetail-params"><ul> |
---|
301 | <li><b>item</b> : Mixed<p class="sub-desc">The collection item</p></li> |
---|
302 | <li><b>index</b> : Number<p class="sub-desc">The item's index</p></li> |
---|
303 | <li><b>length</b> : Number<p class="sub-desc">The total number of items in the collection</p></li> |
---|
304 | </ul></div> |
---|
305 | The function should return a boolean value. Returning false from the function will stop the iteration. <div class="mdetail-params"> |
---|
306 | <strong>Parameters:</strong> |
---|
307 | <ul><li><code>fn</code> : Function<div class="sub-desc">The function to execute for each item.</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope in which to execute the function.</div></li> </ul> |
---|
308 | <strong>Returns:</strong> |
---|
309 | <ul> |
---|
310 | <li><code>void</code></li> |
---|
311 | </ul> |
---|
312 | </div> |
---|
313 | </div> |
---|
314 | </div> |
---|
315 | </td> |
---|
316 | <td class="msource">MixedCollection</td> |
---|
317 | </tr> |
---|
318 | <tr class="method-row expandable"> |
---|
319 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
320 | <td class="sig"> |
---|
321 | <a id="Ext.util.MixedCollection-eachKey"></a> |
---|
322 | <b>eachKey</b>( <code>Function fn</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span> ) : void <div class="mdesc"> |
---|
323 | <div class="short">Executes the specified function once for every key in the collection, passing each |
---|
324 | key, and its associated item as th...</div> |
---|
325 | <div class="long"> |
---|
326 | Executes the specified function once for every key in the collection, passing each |
---|
327 | key, and its associated item as the first two parameters. <div class="mdetail-params"> |
---|
328 | <strong>Parameters:</strong> |
---|
329 | <ul><li><code>fn</code> : Function<div class="sub-desc">The function to execute for each item.</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope in which to execute the function.</div></li> </ul> |
---|
330 | <strong>Returns:</strong> |
---|
331 | <ul> |
---|
332 | <li><code>void</code></li> |
---|
333 | </ul> |
---|
334 | </div> |
---|
335 | </div> |
---|
336 | </div> |
---|
337 | </td> |
---|
338 | <td class="msource">MixedCollection</td> |
---|
339 | </tr> |
---|
340 | <tr class="method-row alt expandable"> |
---|
341 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
342 | <td class="sig"> |
---|
343 | <a id="Ext.util.MixedCollection-filter"></a> |
---|
344 | <b>filter</b>( <code>String property</code>, <code>String/RegExp value</code>, <span class="optional" title="Optional">[<code>Boolean anyMatch</code>]</span>, <span class="optional" title="Optional">[<code>Boolean caseSensitive</code>]</span> ) : MixedCollection <div class="mdesc"> |
---|
345 | <div class="short">Filter the <i>objects</i> in this collection by a specific property. |
---|
346 | Returns a new collection that has been filtered.</div> |
---|
347 | <div class="long"> |
---|
348 | Filter the <i>objects</i> in this collection by a specific property. |
---|
349 | Returns a new collection that has been filtered. <div class="mdetail-params"> |
---|
350 | <strong>Parameters:</strong> |
---|
351 | <ul><li><code>property</code> : String<div class="sub-desc">A property on your objects</div></li><li><code>value</code> : String/RegExp<div class="sub-desc">Either string that the property values |
---|
352 | should start with or a RegExp to test against the property</div></li><li><code>anyMatch</code> : Boolean<div class="sub-desc">(optional) True to match any part of the string, not just the beginning</div></li><li><code>caseSensitive</code> : Boolean<div class="sub-desc">(optional) True for case sensitive comparison (defaults to False).</div></li> </ul> |
---|
353 | <strong>Returns:</strong> |
---|
354 | <ul> |
---|
355 | <li><code>MixedCollection</code><div class="sub-desc">The new filtered collection</div></li> |
---|
356 | </ul> |
---|
357 | </div> |
---|
358 | </div> |
---|
359 | </div> |
---|
360 | </td> |
---|
361 | <td class="msource">MixedCollection</td> |
---|
362 | </tr> |
---|
363 | <tr class="method-row expandable"> |
---|
364 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
365 | <td class="sig"> |
---|
366 | <a id="Ext.util.MixedCollection-filterBy"></a> |
---|
367 | <b>filterBy</b>( <code>Function fn</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span> ) : MixedCollection <div class="mdesc"> |
---|
368 | <div class="short">Filter by a function. Returns a new collection that has been filtered. |
---|
369 | The passed function will be called with each o...</div> |
---|
370 | <div class="long"> |
---|
371 | Filter by a function. Returns a <i>new</i> collection that has been filtered. |
---|
372 | The passed function will be called with each object in the collection. |
---|
373 | If the function returns true, the value is included otherwise it is filtered. <div class="mdetail-params"> |
---|
374 | <strong>Parameters:</strong> |
---|
375 | <ul><li><code>fn</code> : Function<div class="sub-desc">The function to be called, it will receive the args o (the object), k (the key)</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope of the function (defaults to this)</div></li> </ul> |
---|
376 | <strong>Returns:</strong> |
---|
377 | <ul> |
---|
378 | <li><code>MixedCollection</code><div class="sub-desc">The new filtered collection</div></li> |
---|
379 | </ul> |
---|
380 | </div> |
---|
381 | </div> |
---|
382 | </div> |
---|
383 | </td> |
---|
384 | <td class="msource">MixedCollection</td> |
---|
385 | </tr> |
---|
386 | <tr class="method-row alt expandable"> |
---|
387 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
388 | <td class="sig"> |
---|
389 | <a id="Ext.util.MixedCollection-find"></a> |
---|
390 | <b>find</b>( <code>Function fn</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span> ) : Object <div class="mdesc"> |
---|
391 | <div class="short">Returns the first item in the collection which elicits a true return value from the |
---|
392 | passed selection function.</div> |
---|
393 | <div class="long"> |
---|
394 | Returns the first item in the collection which elicits a true return value from the |
---|
395 | passed selection function. <div class="mdetail-params"> |
---|
396 | <strong>Parameters:</strong> |
---|
397 | <ul><li><code>fn</code> : Function<div class="sub-desc">The selection function to execute for each item.</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope in which to execute the function.</div></li> </ul> |
---|
398 | <strong>Returns:</strong> |
---|
399 | <ul> |
---|
400 | <li><code>Object</code><div class="sub-desc">The first item in the collection which returned true from the selection function.</div></li> |
---|
401 | </ul> |
---|
402 | </div> |
---|
403 | </div> |
---|
404 | </div> |
---|
405 | </td> |
---|
406 | <td class="msource">MixedCollection</td> |
---|
407 | </tr> |
---|
408 | <tr class="method-row expandable"> |
---|
409 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
410 | <td class="sig"> |
---|
411 | <a id="Ext.util.MixedCollection-findIndex"></a> |
---|
412 | <b>findIndex</b>( <code>String property</code>, <code>String/RegExp value</code>, <span class="optional" title="Optional">[<code>Number start</code>]</span>, <span class="optional" title="Optional">[<code>Boolean anyMatch</code>]</span>, <span class="optional" title="Optional">[<code>Boolean caseSensitive</code>]</span> ) : Number <div class="mdesc"> |
---|
413 | <div class="short">Finds the index of the first matching object in this collection by a specific property/value.</div> |
---|
414 | <div class="long"> |
---|
415 | Finds the index of the first matching object in this collection by a specific property/value. <div class="mdetail-params"> |
---|
416 | <strong>Parameters:</strong> |
---|
417 | <ul><li><code>property</code> : String<div class="sub-desc">The name of a property on your objects.</div></li><li><code>value</code> : String/RegExp<div class="sub-desc">A string that the property values |
---|
418 | should start with or a RegExp to test against the property.</div></li><li><code>start</code> : Number<div class="sub-desc">(optional) The index to start searching at (defaults to 0).</div></li><li><code>anyMatch</code> : Boolean<div class="sub-desc">(optional) True to match any part of the string, not just the beginning.</div></li><li><code>caseSensitive</code> : Boolean<div class="sub-desc">(optional) True for case sensitive comparison.</div></li> </ul> |
---|
419 | <strong>Returns:</strong> |
---|
420 | <ul> |
---|
421 | <li><code>Number</code><div class="sub-desc">The matched index or -1</div></li> |
---|
422 | </ul> |
---|
423 | </div> |
---|
424 | </div> |
---|
425 | </div> |
---|
426 | </td> |
---|
427 | <td class="msource">MixedCollection</td> |
---|
428 | </tr> |
---|
429 | <tr class="method-row alt expandable"> |
---|
430 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
431 | <td class="sig"> |
---|
432 | <a id="Ext.util.MixedCollection-findIndexBy"></a> |
---|
433 | <b>findIndexBy</b>( <code>Function fn</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span>, <span class="optional" title="Optional">[<code>Number start</code>]</span> ) : Number <div class="mdesc"> |
---|
434 | <div class="short">Find the index of the first matching object in this collection by a function. |
---|
435 | If the function returns true it is cons...</div> |
---|
436 | <div class="long"> |
---|
437 | Find the index of the first matching object in this collection by a function. |
---|
438 | If the function returns <i>true</i> it is considered a match. <div class="mdetail-params"> |
---|
439 | <strong>Parameters:</strong> |
---|
440 | <ul><li><code>fn</code> : Function<div class="sub-desc">The function to be called, it will receive the args o (the object), k (the key).</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope of the function (defaults to this).</div></li><li><code>start</code> : Number<div class="sub-desc">(optional) The index to start searching at (defaults to 0).</div></li> </ul> |
---|
441 | <strong>Returns:</strong> |
---|
442 | <ul> |
---|
443 | <li><code>Number</code><div class="sub-desc">The matched index or -1</div></li> |
---|
444 | </ul> |
---|
445 | </div> |
---|
446 | </div> |
---|
447 | </div> |
---|
448 | </td> |
---|
449 | <td class="msource">MixedCollection</td> |
---|
450 | </tr> |
---|
451 | <tr class="method-row inherited expandable"> |
---|
452 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
453 | <td class="sig"> |
---|
454 | <a id="Ext.util.MixedCollection-fireEvent"></a> |
---|
455 | <b>fireEvent</b>( <code>String eventName</code>, <code>Object... args</code> ) : Boolean <div class="mdesc"> |
---|
456 | <div class="short">Fires the specified event with the passed parameters (minus the event name).</div> |
---|
457 | <div class="long"> |
---|
458 | Fires the specified event with the passed parameters (minus the event name). <div class="mdetail-params"> |
---|
459 | <strong>Parameters:</strong> |
---|
460 | <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> |
---|
461 | <strong>Returns:</strong> |
---|
462 | <ul> |
---|
463 | <li><code>Boolean</code><div class="sub-desc">returns false if any of the handlers return false otherwise it returns true</div></li> |
---|
464 | </ul> |
---|
465 | </div> |
---|
466 | </div> |
---|
467 | </div> |
---|
468 | </td> |
---|
469 | <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#fireEvent" href="output/Ext.util.Observable.html#fireEvent">Observable</a></td> |
---|
470 | </tr> |
---|
471 | <tr class="method-row alt expandable"> |
---|
472 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
473 | <td class="sig"> |
---|
474 | <a id="Ext.util.MixedCollection-first"></a> |
---|
475 | <b>first</b>() : Object <div class="mdesc"> |
---|
476 | <div class="short">Returns the first item in the collection.</div> |
---|
477 | <div class="long"> |
---|
478 | Returns the first item in the collection. <div class="mdetail-params"> |
---|
479 | <strong>Parameters:</strong> |
---|
480 | <ul><li>None.</li> </ul> |
---|
481 | <strong>Returns:</strong> |
---|
482 | <ul> |
---|
483 | <li><code>Object</code><div class="sub-desc">the first item in the collection..</div></li> |
---|
484 | </ul> |
---|
485 | </div> |
---|
486 | </div> |
---|
487 | </div> |
---|
488 | </td> |
---|
489 | <td class="msource">MixedCollection</td> |
---|
490 | </tr> |
---|
491 | <tr class="method-row expandable"> |
---|
492 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
493 | <td class="sig"> |
---|
494 | <a id="Ext.util.MixedCollection-get"></a> |
---|
495 | <b>get</b>( <code>String/Number key</code> ) : Object <div class="mdesc"> |
---|
496 | <div class="short">Returns the item associated with the passed key or index.</div> |
---|
497 | <div class="long"> |
---|
498 | Returns the item associated with the passed key or index. <div class="mdetail-params"> |
---|
499 | <strong>Parameters:</strong> |
---|
500 | <ul><li><code>key</code> : String/Number<div class="sub-desc">The key or index of the item.</div></li> </ul> |
---|
501 | <strong>Returns:</strong> |
---|
502 | <ul> |
---|
503 | <li><code>Object</code><div class="sub-desc">The item associated with the passed key.</div></li> |
---|
504 | </ul> |
---|
505 | </div> |
---|
506 | </div> |
---|
507 | </div> |
---|
508 | </td> |
---|
509 | <td class="msource">MixedCollection</td> |
---|
510 | </tr> |
---|
511 | <tr class="method-row alt expandable"> |
---|
512 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
513 | <td class="sig"> |
---|
514 | <a id="Ext.util.MixedCollection-getCount"></a> |
---|
515 | <b>getCount</b>() : Number <div class="mdesc"> |
---|
516 | <div class="short">Returns the number of items in the collection.</div> |
---|
517 | <div class="long"> |
---|
518 | Returns the number of items in the collection. <div class="mdetail-params"> |
---|
519 | <strong>Parameters:</strong> |
---|
520 | <ul><li>None.</li> </ul> |
---|
521 | <strong>Returns:</strong> |
---|
522 | <ul> |
---|
523 | <li><code>Number</code><div class="sub-desc">the number of items in the collection.</div></li> |
---|
524 | </ul> |
---|
525 | </div> |
---|
526 | </div> |
---|
527 | </div> |
---|
528 | </td> |
---|
529 | <td class="msource">MixedCollection</td> |
---|
530 | </tr> |
---|
531 | <tr class="method-row expandable"> |
---|
532 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
533 | <td class="sig"> |
---|
534 | <a id="Ext.util.MixedCollection-getKey"></a> |
---|
535 | <b>getKey</b>( <code>Object item</code> ) : Object <div class="mdesc"> |
---|
536 | <div class="short">MixedCollection has a generic way to fetch keys if you implement getKey. The default implementation |
---|
537 | simply returns i...</div> |
---|
538 | <div class="long"> |
---|
539 | MixedCollection has a generic way to fetch keys if you implement getKey. The default implementation |
---|
540 | simply returns <tt style="font-weight:bold;">item.id</tt> but you can provide your own implementation |
---|
541 | to return a different value as in the following examples: |
---|
542 | <pre><code><i>// normal way</i> |
---|
543 | <b>var</b> mc = <b>new</b> Ext.util.MixedCollection(); |
---|
544 | mc.add(someEl.dom.id, someEl); |
---|
545 | mc.add(otherEl.dom.id, otherEl); |
---|
546 | <i>//and so on</i> |
---|
547 | |
---|
548 | <i>// using getKey</i> |
---|
549 | <b>var</b> mc = <b>new</b> Ext.util.MixedCollection(); |
---|
550 | mc.getKey = <b>function</b>(el){ |
---|
551 | <b>return</b> el.dom.id; |
---|
552 | }; |
---|
553 | mc.add(someEl); |
---|
554 | mc.add(otherEl); |
---|
555 | |
---|
556 | <i>// or via the constructor</i> |
---|
557 | <b>var</b> mc = <b>new</b> Ext.util.MixedCollection(false, <b>function</b>(el){ |
---|
558 | <b>return</b> el.dom.id; |
---|
559 | }); |
---|
560 | mc.add(someEl); |
---|
561 | mc.add(otherEl);</code></pre> <div class="mdetail-params"> |
---|
562 | <strong>Parameters:</strong> |
---|
563 | <ul><li><code>item</code> : Object<div class="sub-desc">The item for which to find the key.</div></li> </ul> |
---|
564 | <strong>Returns:</strong> |
---|
565 | <ul> |
---|
566 | <li><code>Object</code><div class="sub-desc">The key for the passed item.</div></li> |
---|
567 | </ul> |
---|
568 | </div> |
---|
569 | </div> |
---|
570 | </div> |
---|
571 | </td> |
---|
572 | <td class="msource">MixedCollection</td> |
---|
573 | </tr> |
---|
574 | <tr class="method-row alt expandable"> |
---|
575 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
576 | <td class="sig"> |
---|
577 | <a id="Ext.util.MixedCollection-getRange"></a> |
---|
578 | <b>getRange</b>( <span class="optional" title="Optional">[<code>Number startIndex</code>]</span>, <span class="optional" title="Optional">[<code>Number endIndex</code>]</span> ) : Array <div class="mdesc"> |
---|
579 | <div class="short">Returns a range of items in this collection</div> |
---|
580 | <div class="long"> |
---|
581 | Returns a range of items in this collection <div class="mdetail-params"> |
---|
582 | <strong>Parameters:</strong> |
---|
583 | <ul><li><code>startIndex</code> : Number<div class="sub-desc">(optional) defaults to 0</div></li><li><code>endIndex</code> : Number<div class="sub-desc">(optional) default to the last item</div></li> </ul> |
---|
584 | <strong>Returns:</strong> |
---|
585 | <ul> |
---|
586 | <li><code>Array</code><div class="sub-desc">An array of items</div></li> |
---|
587 | </ul> |
---|
588 | </div> |
---|
589 | </div> |
---|
590 | </div> |
---|
591 | </td> |
---|
592 | <td class="msource">MixedCollection</td> |
---|
593 | </tr> |
---|
594 | <tr class="method-row inherited expandable"> |
---|
595 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
596 | <td class="sig"> |
---|
597 | <a id="Ext.util.MixedCollection-hasListener"></a> |
---|
598 | <b>hasListener</b>( <code>String eventName</code> ) : Boolean <div class="mdesc"> |
---|
599 | <div class="short">Checks to see if this object has any listeners for a specified event</div> |
---|
600 | <div class="long"> |
---|
601 | Checks to see if this object has any listeners for a specified event <div class="mdetail-params"> |
---|
602 | <strong>Parameters:</strong> |
---|
603 | <ul><li><code>eventName</code> : String<div class="sub-desc">The name of the event to check for</div></li> </ul> |
---|
604 | <strong>Returns:</strong> |
---|
605 | <ul> |
---|
606 | <li><code>Boolean</code><div class="sub-desc">True if the event is being listened for, else false</div></li> |
---|
607 | </ul> |
---|
608 | </div> |
---|
609 | </div> |
---|
610 | </div> |
---|
611 | </td> |
---|
612 | <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#hasListener" href="output/Ext.util.Observable.html#hasListener">Observable</a></td> |
---|
613 | </tr> |
---|
614 | <tr class="method-row alt expandable"> |
---|
615 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
616 | <td class="sig"> |
---|
617 | <a id="Ext.util.MixedCollection-indexOf"></a> |
---|
618 | <b>indexOf</b>( <code>Object o</code> ) : Number <div class="mdesc"> |
---|
619 | <div class="short">Returns index within the collection of the passed Object.</div> |
---|
620 | <div class="long"> |
---|
621 | Returns index within the collection of the passed Object. <div class="mdetail-params"> |
---|
622 | <strong>Parameters:</strong> |
---|
623 | <ul><li><code>o</code> : Object<div class="sub-desc">The item to find the index of.</div></li> </ul> |
---|
624 | <strong>Returns:</strong> |
---|
625 | <ul> |
---|
626 | <li><code>Number</code><div class="sub-desc">index of the item. Returns -1 if not found.</div></li> |
---|
627 | </ul> |
---|
628 | </div> |
---|
629 | </div> |
---|
630 | </div> |
---|
631 | </td> |
---|
632 | <td class="msource">MixedCollection</td> |
---|
633 | </tr> |
---|
634 | <tr class="method-row expandable"> |
---|
635 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
636 | <td class="sig"> |
---|
637 | <a id="Ext.util.MixedCollection-indexOfKey"></a> |
---|
638 | <b>indexOfKey</b>( <code>String key</code> ) : Number <div class="mdesc"> |
---|
639 | <div class="short">Returns index within the collection of the passed key.</div> |
---|
640 | <div class="long"> |
---|
641 | Returns index within the collection of the passed key. <div class="mdetail-params"> |
---|
642 | <strong>Parameters:</strong> |
---|
643 | <ul><li><code>key</code> : String<div class="sub-desc">The key to find the index of.</div></li> </ul> |
---|
644 | <strong>Returns:</strong> |
---|
645 | <ul> |
---|
646 | <li><code>Number</code><div class="sub-desc">index of the key.</div></li> |
---|
647 | </ul> |
---|
648 | </div> |
---|
649 | </div> |
---|
650 | </div> |
---|
651 | </td> |
---|
652 | <td class="msource">MixedCollection</td> |
---|
653 | </tr> |
---|
654 | <tr class="method-row alt expandable"> |
---|
655 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
656 | <td class="sig"> |
---|
657 | <a id="Ext.util.MixedCollection-insert"></a> |
---|
658 | <b>insert</b>( <code>Number index</code>, <code>String key</code>, <span class="optional" title="Optional">[<code>Object o</code>]</span> ) : Object <div class="mdesc"> |
---|
659 | <div class="short">Inserts an item at the specified index in the collection. Fires the <a ext:cls="Ext.util.MixedCollection" ext:member="add" href="output/Ext.util.MixedCollection.html#add">add</a> event when complete.</div> |
---|
660 | <div class="long"> |
---|
661 | Inserts an item at the specified index in the collection. Fires the <a ext:cls="Ext.util.MixedCollection" ext:member="add" href="output/Ext.util.MixedCollection.html#add">add</a> event when complete. <div class="mdetail-params"> |
---|
662 | <strong>Parameters:</strong> |
---|
663 | <ul><li><code>index</code> : Number<div class="sub-desc">The index to insert the item at.</div></li><li><code>key</code> : String<div class="sub-desc">The key to associate with the new item, or the item itself.</div></li><li><code>o</code> : Object<div class="sub-desc">(optional) If the second parameter was a key, the new item.</div></li> </ul> |
---|
664 | <strong>Returns:</strong> |
---|
665 | <ul> |
---|
666 | <li><code>Object</code><div class="sub-desc">The item inserted.</div></li> |
---|
667 | </ul> |
---|
668 | </div> |
---|
669 | </div> |
---|
670 | </div> |
---|
671 | </td> |
---|
672 | <td class="msource">MixedCollection</td> |
---|
673 | </tr> |
---|
674 | <tr class="method-row expandable"> |
---|
675 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
676 | <td class="sig"> |
---|
677 | <a id="Ext.util.MixedCollection-item"></a> |
---|
678 | <b>item</b>( <code>String/Number key</code> ) : Object <div class="mdesc"> |
---|
679 | <div class="short">Returns the item associated with the passed key OR index. Key has priority over index. This is the equivalent |
---|
680 | of cal...</div> |
---|
681 | <div class="long"> |
---|
682 | Returns the item associated with the passed key OR index. Key has priority over index. This is the equivalent |
---|
683 | of calling <a ext:cls="Ext.util.MixedCollection" ext:member="key" href="output/Ext.util.MixedCollection.html#key">key</a> first, then if nothing matched calling <a ext:cls="Ext.util.MixedCollection" ext:member="itemAt" href="output/Ext.util.MixedCollection.html#itemAt">itemAt</a>. <div class="mdetail-params"> |
---|
684 | <strong>Parameters:</strong> |
---|
685 | <ul><li><code>key</code> : String/Number<div class="sub-desc">The key or index of the item.</div></li> </ul> |
---|
686 | <strong>Returns:</strong> |
---|
687 | <ul> |
---|
688 | <li><code>Object</code><div class="sub-desc">The item associated with the passed key.</div></li> |
---|
689 | </ul> |
---|
690 | </div> |
---|
691 | </div> |
---|
692 | </div> |
---|
693 | </td> |
---|
694 | <td class="msource">MixedCollection</td> |
---|
695 | </tr> |
---|
696 | <tr class="method-row alt expandable"> |
---|
697 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
698 | <td class="sig"> |
---|
699 | <a id="Ext.util.MixedCollection-itemAt"></a> |
---|
700 | <b>itemAt</b>( <code>Number index</code> ) : Object <div class="mdesc"> |
---|
701 | <div class="short">Returns the item at the specified index.</div> |
---|
702 | <div class="long"> |
---|
703 | Returns the item at the specified index. <div class="mdetail-params"> |
---|
704 | <strong>Parameters:</strong> |
---|
705 | <ul><li><code>index</code> : Number<div class="sub-desc">The index of the item.</div></li> </ul> |
---|
706 | <strong>Returns:</strong> |
---|
707 | <ul> |
---|
708 | <li><code>Object</code><div class="sub-desc">The item at the specified index.</div></li> |
---|
709 | </ul> |
---|
710 | </div> |
---|
711 | </div> |
---|
712 | </div> |
---|
713 | </td> |
---|
714 | <td class="msource">MixedCollection</td> |
---|
715 | </tr> |
---|
716 | <tr class="method-row expandable"> |
---|
717 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
718 | <td class="sig"> |
---|
719 | <a id="Ext.util.MixedCollection-key"></a> |
---|
720 | <b>key</b>( <code>String/Number key</code> ) : Object <div class="mdesc"> |
---|
721 | <div class="short">Returns the item associated with the passed key.</div> |
---|
722 | <div class="long"> |
---|
723 | Returns the item associated with the passed key. <div class="mdetail-params"> |
---|
724 | <strong>Parameters:</strong> |
---|
725 | <ul><li><code>key</code> : String/Number<div class="sub-desc">The key of the item.</div></li> </ul> |
---|
726 | <strong>Returns:</strong> |
---|
727 | <ul> |
---|
728 | <li><code>Object</code><div class="sub-desc">The item associated with the passed key.</div></li> |
---|
729 | </ul> |
---|
730 | </div> |
---|
731 | </div> |
---|
732 | </div> |
---|
733 | </td> |
---|
734 | <td class="msource">MixedCollection</td> |
---|
735 | </tr> |
---|
736 | <tr class="method-row alt expandable"> |
---|
737 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
738 | <td class="sig"> |
---|
739 | <a id="Ext.util.MixedCollection-keySort"></a> |
---|
740 | <b>keySort</b>( <span class="optional" title="Optional">[<code>String direction</code>]</span>, <span class="optional" title="Optional">[<code>Function fn</code>]</span> ) : void <div class="mdesc"> |
---|
741 | <div class="short">Sorts this collection by keys</div> |
---|
742 | <div class="long"> |
---|
743 | Sorts this collection by keys <div class="mdetail-params"> |
---|
744 | <strong>Parameters:</strong> |
---|
745 | <ul><li><code>direction</code> : String<div class="sub-desc">(optional) "ASC" or "DESC"</div></li><li><code>fn</code> : Function<div class="sub-desc">(optional) a comparison function (defaults to case insensitive string)</div></li> </ul> |
---|
746 | <strong>Returns:</strong> |
---|
747 | <ul> |
---|
748 | <li><code>void</code></li> |
---|
749 | </ul> |
---|
750 | </div> |
---|
751 | </div> |
---|
752 | </div> |
---|
753 | </td> |
---|
754 | <td class="msource">MixedCollection</td> |
---|
755 | </tr> |
---|
756 | <tr class="method-row expandable"> |
---|
757 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
758 | <td class="sig"> |
---|
759 | <a id="Ext.util.MixedCollection-last"></a> |
---|
760 | <b>last</b>() : Object <div class="mdesc"> |
---|
761 | <div class="short">Returns the last item in the collection.</div> |
---|
762 | <div class="long"> |
---|
763 | Returns the last item in the collection. <div class="mdetail-params"> |
---|
764 | <strong>Parameters:</strong> |
---|
765 | <ul><li>None.</li> </ul> |
---|
766 | <strong>Returns:</strong> |
---|
767 | <ul> |
---|
768 | <li><code>Object</code><div class="sub-desc">the last item in the collection..</div></li> |
---|
769 | </ul> |
---|
770 | </div> |
---|
771 | </div> |
---|
772 | </div> |
---|
773 | </td> |
---|
774 | <td class="msource">MixedCollection</td> |
---|
775 | </tr> |
---|
776 | <tr class="method-row inherited alt expandable"> |
---|
777 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
778 | <td class="sig"> |
---|
779 | <a id="Ext.util.MixedCollection-on"></a> |
---|
780 | <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"> |
---|
781 | <div class="short">Appends an event handler to this element (shorthand for addListener)</div> |
---|
782 | <div class="long"> |
---|
783 | Appends an event handler to this element (shorthand for addListener) <div class="mdetail-params"> |
---|
784 | <strong>Parameters:</strong> |
---|
785 | <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 |
---|
786 | function. The handler function's "this" context.</div></li><li><code>options</code> : Object<div class="sub-desc">(optional)</div></li> </ul> |
---|
787 | <strong>Returns:</strong> |
---|
788 | <ul> |
---|
789 | <li><code>void</code></li> |
---|
790 | </ul> |
---|
791 | </div> |
---|
792 | </div> |
---|
793 | </div> |
---|
794 | </td> |
---|
795 | <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#on" href="output/Ext.util.Observable.html#on">Observable</a></td> |
---|
796 | </tr> |
---|
797 | <tr class="method-row inherited expandable"> |
---|
798 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
799 | <td class="sig"> |
---|
800 | <a id="Ext.util.MixedCollection-purgeListeners"></a> |
---|
801 | <b>purgeListeners</b>() : void <div class="mdesc"> |
---|
802 | <div class="short">Removes all listeners for this object</div> |
---|
803 | <div class="long"> |
---|
804 | Removes all listeners for this object <div class="mdetail-params"> |
---|
805 | <strong>Parameters:</strong> |
---|
806 | <ul><li>None.</li> </ul> |
---|
807 | <strong>Returns:</strong> |
---|
808 | <ul> |
---|
809 | <li><code>void</code></li> |
---|
810 | </ul> |
---|
811 | </div> |
---|
812 | </div> |
---|
813 | </div> |
---|
814 | </td> |
---|
815 | <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#purgeListeners" href="output/Ext.util.Observable.html#purgeListeners">Observable</a></td> |
---|
816 | </tr> |
---|
817 | <tr class="method-row inherited alt expandable"> |
---|
818 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
819 | <td class="sig"> |
---|
820 | <a id="Ext.util.MixedCollection-relayEvents"></a> |
---|
821 | <b>relayEvents</b>( <code>Object o</code>, <code>Array events</code> ) : void <div class="mdesc"> |
---|
822 | <div class="short">Relays selected events from the specified Observable as if the events were fired by <tt><b>this</b></tt>.</div> |
---|
823 | <div class="long"> |
---|
824 | Relays selected events from the specified Observable as if the events were fired by <tt><b>this</b></tt>. <div class="mdetail-params"> |
---|
825 | <strong>Parameters:</strong> |
---|
826 | <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> |
---|
827 | <strong>Returns:</strong> |
---|
828 | <ul> |
---|
829 | <li><code>void</code></li> |
---|
830 | </ul> |
---|
831 | </div> |
---|
832 | </div> |
---|
833 | </div> |
---|
834 | </td> |
---|
835 | <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#relayEvents" href="output/Ext.util.Observable.html#relayEvents">Observable</a></td> |
---|
836 | </tr> |
---|
837 | <tr class="method-row expandable"> |
---|
838 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
839 | <td class="sig"> |
---|
840 | <a id="Ext.util.MixedCollection-remove"></a> |
---|
841 | <b>remove</b>( <code>Object o</code> ) : Object <div class="mdesc"> |
---|
842 | <div class="short">Remove an item from the collection.</div> |
---|
843 | <div class="long"> |
---|
844 | Remove an item from the collection. <div class="mdetail-params"> |
---|
845 | <strong>Parameters:</strong> |
---|
846 | <ul><li><code>o</code> : Object<div class="sub-desc">The item to remove.</div></li> </ul> |
---|
847 | <strong>Returns:</strong> |
---|
848 | <ul> |
---|
849 | <li><code>Object</code><div class="sub-desc">The item removed or false if no item was removed.</div></li> |
---|
850 | </ul> |
---|
851 | </div> |
---|
852 | </div> |
---|
853 | </div> |
---|
854 | </td> |
---|
855 | <td class="msource">MixedCollection</td> |
---|
856 | </tr> |
---|
857 | <tr class="method-row alt expandable"> |
---|
858 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
859 | <td class="sig"> |
---|
860 | <a id="Ext.util.MixedCollection-removeAt"></a> |
---|
861 | <b>removeAt</b>( <code>Number index</code> ) : Object <div class="mdesc"> |
---|
862 | <div class="short">Remove an item from a specified index in the collection. Fires the <a ext:cls="Ext.util.MixedCollection" ext:member="remove" href="output/Ext.util.MixedCollection.html#remove">remove</a> event when complete.</div> |
---|
863 | <div class="long"> |
---|
864 | Remove an item from a specified index in the collection. Fires the <a ext:cls="Ext.util.MixedCollection" ext:member="remove" href="output/Ext.util.MixedCollection.html#remove">remove</a> event when complete. <div class="mdetail-params"> |
---|
865 | <strong>Parameters:</strong> |
---|
866 | <ul><li><code>index</code> : Number<div class="sub-desc">The index within the collection of the item to remove.</div></li> </ul> |
---|
867 | <strong>Returns:</strong> |
---|
868 | <ul> |
---|
869 | <li><code>Object</code><div class="sub-desc">The item removed or false if no item was removed.</div></li> |
---|
870 | </ul> |
---|
871 | </div> |
---|
872 | </div> |
---|
873 | </div> |
---|
874 | </td> |
---|
875 | <td class="msource">MixedCollection</td> |
---|
876 | </tr> |
---|
877 | <tr class="method-row expandable"> |
---|
878 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
879 | <td class="sig"> |
---|
880 | <a id="Ext.util.MixedCollection-removeKey"></a> |
---|
881 | <b>removeKey</b>( <code>String key</code> ) : Object <div class="mdesc"> |
---|
882 | <div class="short">Removed an item associated with the passed key fom the collection.</div> |
---|
883 | <div class="long"> |
---|
884 | Removed an item associated with the passed key fom the collection. <div class="mdetail-params"> |
---|
885 | <strong>Parameters:</strong> |
---|
886 | <ul><li><code>key</code> : String<div class="sub-desc">The key of the item to remove.</div></li> </ul> |
---|
887 | <strong>Returns:</strong> |
---|
888 | <ul> |
---|
889 | <li><code>Object</code><div class="sub-desc">The item removed or false if no item was removed.</div></li> |
---|
890 | </ul> |
---|
891 | </div> |
---|
892 | </div> |
---|
893 | </div> |
---|
894 | </td> |
---|
895 | <td class="msource">MixedCollection</td> |
---|
896 | </tr> |
---|
897 | <tr class="method-row inherited alt expandable"> |
---|
898 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
899 | <td class="sig"> |
---|
900 | <a id="Ext.util.MixedCollection-removeListener"></a> |
---|
901 | <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"> |
---|
902 | <div class="short">Removes a listener</div> |
---|
903 | <div class="long"> |
---|
904 | Removes a listener <div class="mdetail-params"> |
---|
905 | <strong>Parameters:</strong> |
---|
906 | <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> |
---|
907 | <strong>Returns:</strong> |
---|
908 | <ul> |
---|
909 | <li><code>void</code></li> |
---|
910 | </ul> |
---|
911 | </div> |
---|
912 | </div> |
---|
913 | </div> |
---|
914 | </td> |
---|
915 | <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#removeListener" href="output/Ext.util.Observable.html#removeListener">Observable</a></td> |
---|
916 | </tr> |
---|
917 | <tr class="method-row expandable"> |
---|
918 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
919 | <td class="sig"> |
---|
920 | <a id="Ext.util.MixedCollection-replace"></a> |
---|
921 | <b>replace</b>( <code>String key</code>, <span class="optional" title="Optional">[<code>o {Object}</code>]</span> ) : Object <div class="mdesc"> |
---|
922 | <div class="short">Replaces an item in the collection. Fires the <a ext:cls="Ext.util.MixedCollection" ext:member="replace" href="output/Ext.util.MixedCollection.html#replace">replace</a> event when complete.</div> |
---|
923 | <div class="long"> |
---|
924 | Replaces an item in the collection. Fires the <a ext:cls="Ext.util.MixedCollection" ext:member="replace" href="output/Ext.util.MixedCollection.html#replace">replace</a> event when complete. <div class="mdetail-params"> |
---|
925 | <strong>Parameters:</strong> |
---|
926 | <ul><li><code>key</code> : String<div class="sub-desc"><p>The key associated with the item to replace, or the replacement item.</p> |
---|
927 | <p>If you supplied a <a ext:cls="Ext.util.MixedCollection" ext:member="getKey" href="output/Ext.util.MixedCollection.html#getKey">getKey</a> implementation for this MixedCollection, or if the key |
---|
928 | of your stored items is in a property called <tt><b>id</b></tt>, then the MixedCollection |
---|
929 | will be able to <i>derive</i> the key of the replacement item. If you want to replace an item |
---|
930 | with one having the same key value, then just pass the replacement item in this parameter.</p></div></li><li><code>{Object}</code> : o<div class="sub-desc">o (optional) If the first parameter passed was a key, the item to associate |
---|
931 | with that key.</div></li> </ul> |
---|
932 | <strong>Returns:</strong> |
---|
933 | <ul> |
---|
934 | <li><code>Object</code><div class="sub-desc">The new item.</div></li> |
---|
935 | </ul> |
---|
936 | </div> |
---|
937 | </div> |
---|
938 | </div> |
---|
939 | </td> |
---|
940 | <td class="msource">MixedCollection</td> |
---|
941 | </tr> |
---|
942 | <tr class="method-row inherited alt expandable"> |
---|
943 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
944 | <td class="sig"> |
---|
945 | <a id="Ext.util.MixedCollection-resumeEvents"></a> |
---|
946 | <b>resumeEvents</b>() : void <div class="mdesc"> |
---|
947 | <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> |
---|
948 | <div class="long"> |
---|
949 | 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"> |
---|
950 | <strong>Parameters:</strong> |
---|
951 | <ul><li>None.</li> </ul> |
---|
952 | <strong>Returns:</strong> |
---|
953 | <ul> |
---|
954 | <li><code>void</code></li> |
---|
955 | </ul> |
---|
956 | </div> |
---|
957 | </div> |
---|
958 | </div> |
---|
959 | </td> |
---|
960 | <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#resumeEvents" href="output/Ext.util.Observable.html#resumeEvents">Observable</a></td> |
---|
961 | </tr> |
---|
962 | <tr class="method-row expandable"> |
---|
963 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
964 | <td class="sig"> |
---|
965 | <a id="Ext.util.MixedCollection-sort"></a> |
---|
966 | <b>sort</b>( <span class="optional" title="Optional">[<code>String direction</code>]</span>, <span class="optional" title="Optional">[<code>Function fn</code>]</span> ) : void <div class="mdesc"> |
---|
967 | <div class="short">Sorts this collection with the passed comparison function</div> |
---|
968 | <div class="long"> |
---|
969 | Sorts this collection with the passed comparison function <div class="mdetail-params"> |
---|
970 | <strong>Parameters:</strong> |
---|
971 | <ul><li><code>direction</code> : String<div class="sub-desc">(optional) "ASC" or "DESC"</div></li><li><code>fn</code> : Function<div class="sub-desc">(optional) comparison function</div></li> </ul> |
---|
972 | <strong>Returns:</strong> |
---|
973 | <ul> |
---|
974 | <li><code>void</code></li> |
---|
975 | </ul> |
---|
976 | </div> |
---|
977 | </div> |
---|
978 | </div> |
---|
979 | </td> |
---|
980 | <td class="msource">MixedCollection</td> |
---|
981 | </tr> |
---|
982 | <tr class="method-row inherited alt expandable"> |
---|
983 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
984 | <td class="sig"> |
---|
985 | <a id="Ext.util.MixedCollection-suspendEvents"></a> |
---|
986 | <b>suspendEvents</b>() : void <div class="mdesc"> |
---|
987 | <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> |
---|
988 | <div class="long"> |
---|
989 | 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"> |
---|
990 | <strong>Parameters:</strong> |
---|
991 | <ul><li>None.</li> </ul> |
---|
992 | <strong>Returns:</strong> |
---|
993 | <ul> |
---|
994 | <li><code>void</code></li> |
---|
995 | </ul> |
---|
996 | </div> |
---|
997 | </div> |
---|
998 | </div> |
---|
999 | </td> |
---|
1000 | <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#suspendEvents" href="output/Ext.util.Observable.html#suspendEvents">Observable</a></td> |
---|
1001 | </tr> |
---|
1002 | <tr class="method-row inherited expandable"> |
---|
1003 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
1004 | <td class="sig"> |
---|
1005 | <a id="Ext.util.MixedCollection-un"></a> |
---|
1006 | <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"> |
---|
1007 | <div class="short">Removes a listener (shorthand for removeListener)</div> |
---|
1008 | <div class="long"> |
---|
1009 | Removes a listener (shorthand for removeListener) <div class="mdetail-params"> |
---|
1010 | <strong>Parameters:</strong> |
---|
1011 | <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> |
---|
1012 | <strong>Returns:</strong> |
---|
1013 | <ul> |
---|
1014 | <li><code>void</code></li> |
---|
1015 | </ul> |
---|
1016 | </div> |
---|
1017 | </div> |
---|
1018 | </div> |
---|
1019 | </td> |
---|
1020 | <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#un" href="output/Ext.util.Observable.html#un">Observable</a></td> |
---|
1021 | </tr> |
---|
1022 | </table> |
---|
1023 | <a id="Ext.util.MixedCollection-events"></a> |
---|
1024 | <h2>Public Events</h2> |
---|
1025 | <table cellspacing="0" class="member-table"> |
---|
1026 | <tr> |
---|
1027 | <th class="sig-header" colspan="2">Event</th> |
---|
1028 | <th class="msource-header">Defined By</th> |
---|
1029 | </tr> |
---|
1030 | <tr class="event-row expandable"> |
---|
1031 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
1032 | <td class="sig"> |
---|
1033 | <a id="Ext.util.MixedCollection-add"></a> |
---|
1034 | <b>add</b> : ( <code>Number index</code>, <code>Object o</code>, <code>String key</code> ) <div class="mdesc"> |
---|
1035 | <div class="short">Fires when an item is added to the collection.</div> |
---|
1036 | <div class="long"> |
---|
1037 | Fires when an item is added to the collection. <div class="mdetail-params"> |
---|
1038 | <strong style="font-weight:normal;">Listeners will be called with the following arguments:</strong> |
---|
1039 | <ul><li><code>index</code> : Number<div class="sub-desc">The index at which the item was added.</div></li><li><code>o</code> : Object<div class="sub-desc">The item added.</div></li><li><code>key</code> : String<div class="sub-desc">The key associated with the added item.</div></li> </ul> |
---|
1040 | </div> |
---|
1041 | </div> |
---|
1042 | </div> |
---|
1043 | </td> |
---|
1044 | <td class="msource">MixedCollection</td> |
---|
1045 | </tr> |
---|
1046 | <tr class="event-row alt expandable"> |
---|
1047 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
1048 | <td class="sig"> |
---|
1049 | <a id="Ext.util.MixedCollection-clear"></a> |
---|
1050 | <b>clear</b> : () <div class="mdesc"> |
---|
1051 | <div class="short">Fires when the collection is cleared.</div> |
---|
1052 | <div class="long"> |
---|
1053 | Fires when the collection is cleared. <div class="mdetail-params"> |
---|
1054 | <strong style="font-weight:normal;">Listeners will be called with the following arguments:</strong> |
---|
1055 | <ul><li>None.</li> </ul> |
---|
1056 | </div> |
---|
1057 | </div> |
---|
1058 | </div> |
---|
1059 | </td> |
---|
1060 | <td class="msource">MixedCollection</td> |
---|
1061 | </tr> |
---|
1062 | <tr class="event-row expandable"> |
---|
1063 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
1064 | <td class="sig"> |
---|
1065 | <a id="Ext.util.MixedCollection-remove"></a> |
---|
1066 | <b>remove</b> : ( <code>Object o</code>, <span class="optional" title="Optional">[<code>String key</code>]</span> ) <div class="mdesc"> |
---|
1067 | <div class="short">Fires when an item is removed from the collection.</div> |
---|
1068 | <div class="long"> |
---|
1069 | Fires when an item is removed from the collection. <div class="mdetail-params"> |
---|
1070 | <strong style="font-weight:normal;">Listeners will be called with the following arguments:</strong> |
---|
1071 | <ul><li><code>o</code> : Object<div class="sub-desc">The item being removed.</div></li><li><code>key</code> : String<div class="sub-desc">(optional) The key associated with the removed item.</div></li> </ul> |
---|
1072 | </div> |
---|
1073 | </div> |
---|
1074 | </div> |
---|
1075 | </td> |
---|
1076 | <td class="msource">MixedCollection</td> |
---|
1077 | </tr> |
---|
1078 | <tr class="event-row alt expandable"> |
---|
1079 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
1080 | <td class="sig"> |
---|
1081 | <a id="Ext.util.MixedCollection-replace"></a> |
---|
1082 | <b>replace</b> : ( <code>String key</code>, <code>Object old</code>, <code>Object new</code> ) <div class="mdesc"> |
---|
1083 | <div class="short">Fires when an item is replaced in the collection.</div> |
---|
1084 | <div class="long"> |
---|
1085 | Fires when an item is replaced in the collection. <div class="mdetail-params"> |
---|
1086 | <strong style="font-weight:normal;">Listeners will be called with the following arguments:</strong> |
---|
1087 | <ul><li><code>key</code> : String<div class="sub-desc">he key associated with the new added.</div></li><li><code>old</code> : Object<div class="sub-desc">The item being replaced.</div></li><li><code>new</code> : Object<div class="sub-desc">The new item.</div></li> </ul> |
---|
1088 | </div> |
---|
1089 | </div> |
---|
1090 | </div> |
---|
1091 | </td> |
---|
1092 | <td class="msource">MixedCollection</td> |
---|
1093 | </tr> |
---|
1094 | </table> |
---|
1095 | |
---|
1096 | </div> |
---|