|
| add( String key , Object o )
:
- ObjectAdds an item to the collection. Fires the add event when complete. Adds an item to the collection. Fires the add event when complete. Parameters:key : StringThe key to associate with the item, or the new item.
- If a getKey implementation was specified for this MixedCollection,
-or if the key of the stored items is in a property called id,
-the MixedCollection will be able to derive the key for the new item.
+ Object Adds an item to the collection. Fires the add event when complete. Adds an item to the collection. Fires the add event when complete. Parameters:key : StringThe key to associate with the item, or the new item.
+ If a getKey implementation was specified for this MixedCollection,
+or if the key of the stored items is in a property called id,
+the MixedCollection will be able to derive the key for the new item.
In this case just pass the new item in this parameter. o : ObjectThe item to add. Returns:
| MixedCollection |
| addAll( Object/Array objs )
:
- voidAdds all elements of an Array or an Object to the collection. Adds all elements of an Array or an Object to the collection. Parameters:objs : Object/ArrayAn Object containing properties which will be added
-to the collection, or an Array of values, each of which are added to the collection.
-Functions references will be added to the collection if allowFunctions
+ void Adds all elements of an Array or an Object to the collection. Adds all elements of an Array or an Object to the collection. Parameters:objs : Object/ArrayAn Object containing properties which will be added
+to the collection, or an Array of values, each of which are added to the collection.
+Functions references will be added to the collection if allowFunctions
has been set to true. Returns:
| MixedCollection |
| addEvents( Object|String o , string Optional. )
:
voidAdds the specified events to the list of events which this Observable may fire. Adds the specified events to the list of events which this Observable may fire. Parameters:o : Object|StringEither an object with event names as properties with a value of true
@@ -76,18 +76,18 @@ Or a shorthand syntax:
:
Boolean Returns true if the collection contains the passed Object as a key. Returns true if the collection contains the passed Object as a key.
| MixedCollection |
| each( Function fn , [Object scope ] )
:
- voidExecutes the specified function once for every item in the collection, passing the following arguments:
-<div class="... Executes the specified function once for every item in the collection, passing the following arguments:
-
-The function should return a boolean value. Returning false from the function will stop the iteration. | MixedCollection |
| eachKey( Function fn , [Object scope ] )
+ voidExecutes the specified function once for every item in the collection, passing the following arguments:
+<div class="m... Executes the specified function once for every item in the collection, passing the following arguments:
+
+The function should return a boolean value. Returning false from the function will stop the iteration. | MixedCollection |
| eachKey( Function fn , [Object scope ] )
:
- voidExecutes the specified function once for every key in the collection, passing each
-key, and its associated item as t... Executes the specified function once for every key in the collection, passing each
-key, and its associated item as the first two parameters. | MixedCollection |
| enableBubble( Object events )
+ voidExecutes the specified function once for every key in the collection, passing each
+key, and its associated item as th... Executes the specified function once for every key in the collection, passing each
+key, and its associated item as the first two parameters. | MixedCollection |
| enableBubble( String/Array events )
:
voidEnables events fired by this Observable to bubble up an owner hierarchy by calling
this.getBubbleTarget() if present... Enables events fired by this Observable to bubble up an owner hierarchy by calling
@@ -96,13 +96,13 @@ this.getBubbleTarget() if present... Enables events fi
implementation in Ext.Component returns the Component's immediate owner. But if a known target is required, this can be overridden to
access the required target more quickly.
Example: Ext.override(Ext.form.Field, {
-// Add functionality to Field's initComponent to enable the change event to bubble
- initComponent: Ext.form.Field.prototype.initComponent.createSequence(function() {
- this.enableBubble('change');
+ // Add functionality to Field's initComponent to enable the change event to bubble
+ initComponent : Ext.form.Field.prototype.initComponent.createSequence(function() {
+ this.enableBubble('change');
}),
-// We know that we want Field's events to bubble directly to the FormPanel.
- getBubbleTarget: function() {
+ // We know that we want Field's events to bubble directly to the FormPanel.
+ getBubbleTarget : function() {
if (!this.formPanel) {
this.formPanel = this.findParentByType('form');
}
@@ -117,32 +117,32 @@ access the required target more quickly.
}],
listeners: {
change: function() {
-// Title goes red if form has been modified.
- myForm.header.setStyle("color", "red");
+ // Title goes red if form has been modified.
+ myForm.header.setStyle('color', 'red');
}
}
-});
| Observable |
| filter( String property , String/RegExp value , [Boolean anyMatch ], [Boolean caseSensitive ] )
+}); | Observable |
| filter( String property , String/RegExp value , [Boolean anyMatch ], [Boolean caseSensitive ] )
:
- MixedCollectionFilter the objects in this collection by a specific property.
-Returns a new collection that has been filtered. Filter the objects in this collection by a specific property.
-Returns a new collection that has been filtered. | MixedCollection |
| filterBy( Function fn , [Object scope ] )
:
- MixedCollectionFilter by a function. Returns a new collection that has been filtered.
-The passed function will be called with each ... Filter by a function. Returns a new collection that has been filtered.
-The passed function will be called with each object in the collection.
-If the function returns true, the value is included otherwise it is filtered. Parameters:fn : FunctionThe function to be called, it will receive the args o (the object), k (the key) scope : Object(optional) The scope of the function (defaults to this) Returns: | MixedCollection |
| find( Function fn , [Object scope ] )
+ MixedCollectionFilter by a function. Returns a new collection that has been filtered.
+The passed function will be called with each o... Filter by a function. Returns a new collection that has been filtered.
+The passed function will be called with each object in the collection.
+If the function returns true, the value is included otherwise it is filtered. Parameters:fn : FunctionThe function to be called, it will receive the args o (the object), k (the key) scope : Object(optional) The scope (this reference) in which the function is executed. Defaults to this MixedCollection. Returns: | MixedCollection |
| find( Function fn , [Object scope ] )
:
- ObjectReturns the first item in the collection which elicits a true return value from the
-passed selection function. Returns the first item in the collection which elicits a true return value from the
-passed selection function. | MixedCollection |
| findIndex( String property , String/RegExp value , [Number start ], [Boolean anyMatch ], [Boolean caseSensitive ] )
+ ObjectReturns the first item in the collection which elicits a true return value from the
+passed selection function. Returns the first item in the collection which elicits a true return value from the
+passed selection function. | MixedCollection |
| findIndex( String property , String/RegExp value , [Number start ], [Boolean anyMatch ], [Boolean caseSensitive ] )
:
- NumberFinds the index of the first matching object in this collection by a specific property/value. Finds the index of the first matching object in this collection by a specific property/value. | MixedCollection |
| findIndexBy( Function fn , [Object scope ], [Number start ] )
:
- NumberFind the index of the first matching object in this collection by a function.
-If the function returns true it is con... Find the index of the first matching object in this collection by a function.
-If the function returns true it is considered a match. Parameters:fn : FunctionThe function to be called, it will receive the args o (the object), k (the key). scope : Object(optional) The scope of the function (defaults to this). start : Number(optional) The index to start searching at (defaults to 0). Returns:Number The matched index or -1
| MixedCollection |
| fireEvent( String eventName , Object... args )
+ NumberFind the index of the first matching object in this collection by a function.
+If the function returns true it is cons... Find the index of the first matching object in this collection by a function.
+If the function returns true it is considered a match. Parameters:fn : FunctionThe function to be called, it will receive the args o (the object), k (the key). scope : Object(optional) The scope (this reference) in which the function is executed. Defaults to this MixedCollection. start : Number(optional) The index to start searching at (defaults to 0). Returns:Number The matched index or -1
| MixedCollection |
| fireEvent( String eventName , Object... args )
:
BooleanFires the specified event with the passed parameters (minus the event name).
An event may be set to bubble up an Obse... | MixedCollection |
| get( String/Number key )
:
- ObjectThis method calls item().
-Returns the item associated with the passed key OR index. Key has priority
-over index. T... This method calls item().
+ Object This method calls item().
Returns the item associated with the passed key OR index. Key has priority
-over index. This is the equivalent of calling key first, then if
-nothing matched calling itemAt. Parameters:Returns:Object If the item is found, returns the item. If the item was
-not found, returns <tt>undefined</tt>. If an item was found, but is a Class,
+over index. Thi... This method calls item().
+Returns the item associated with the passed key OR index. Key has priority
+over index. This is the equivalent of calling key first, then if
+nothing matched calling itemAt. Parameters:Returns:Object If the item is found, returns the item. If the item was
+not found, returns <tt>undefined</tt>. If an item was found, but is a Class,
returns <tt>null</tt>.
| MixedCollection |
| getCount()
:
NumberReturns the number of items in the collection. Returns the number of items in the collection. | MixedCollection |
| getKey( Object item )
:
- ObjectMixedCollection has a generic way to fetch keys if you implement getKey. The default implementation
-simply returns ... MixedCollection has a generic way to fetch keys if you implement getKey. The default implementation
-simply returns item.id but you can provide your own implementation
-to return a different value as in the following examples: // normal way
-var mc = new Ext.util.MixedCollection();
-mc.add(someEl.dom.id, someEl);
-mc.add(otherEl.dom.id, otherEl);
-//and so on
-
-// using getKey
-var mc = new Ext.util.MixedCollection();
-mc.getKey = function(el){
- return el.dom.id;
-};
-mc.add(someEl);
-mc.add(otherEl);
-
-// or via the constructor
-var mc = new Ext.util.MixedCollection(false, function(el){
- return el.dom.id;
-});
-mc.add(someEl);
+ ObjectMixedCollection has a generic way to fetch keys if you implement getKey. The default implementation
+simply returns i... MixedCollection has a generic way to fetch keys if you implement getKey. The default implementation
+simply returns item.id but you can provide your own implementation
+to return a different value as in the following examples: // normal way
+var mc = new Ext.util.MixedCollection();
+mc.add(someEl.dom.id, someEl);
+mc.add(otherEl.dom.id, otherEl);
+//and so on
+
+// using getKey
+var mc = new Ext.util.MixedCollection();
+mc.getKey = function(el){
+ return el.dom.id;
+};
+mc.add(someEl);
+mc.add(otherEl);
+
+// or via the constructor
+var mc = new Ext.util.MixedCollection(false, function(el){
+ return el.dom.id;
+});
+mc.add(someEl);
mc.add(otherEl);
| MixedCollection |
| getRange( [Number startIndex ], [Number endIndex ] )
:
ArrayReturns a range of items in this collection Returns a range of items in this collection | MixedCollection |
| hasListener( String eventName )
@@ -196,18 +196,18 @@ mc.add(otherEl);Parameters:Inserts an item at the specified index in the collection. Fires the add event when complete. Inserts an item at the specified index in the collection. Fires the add event when complete. Parameters:index : NumberThe index to insert the item at. key : StringThe key to associate with the new item, or the item itself. o : Object(optional) If the second parameter was a key, the new item. Returns: | MixedCollection |
| item( String/Number key )
:
- ObjectReturns the item associated with the passed key OR index.
-Key has priority over index. This is the equivalent
-of c... Returns the item associated with the passed key OR index.
+ Object Returns the item associated with the passed key OR index.
Key has priority over index. This is the equivalent
-of calling key first, then if nothing matched calling itemAt. | MixedCollection |
| itemAt( Number index )
:
ObjectReturns the item at the specified index. Returns the item at the specified index. Parameters:index : NumberThe index of the item. Returns: | MixedCollection |
| key( String/Number key )
:
ObjectReturns the item associated with the passed key. Returns the item associated with the passed key. Parameters:key : String/NumberThe key of the item. Returns: | MixedCollection |
| keySort( [String direction ], [Function fn ] )
:
- voidSorts this collection by keys. Sorts this collection by keys. | MixedCollection |
| last()
:
ObjectReturns the last item in the collection. Returns the last item in the collection. | MixedCollection |
| lookup( String/Object id )
@@ -233,11 +233,11 @@ manually. Any store initialized with a Removes an event handler. Removes an event handler. | Observable |
| replace( String key , o {Object} )
:
- ObjectReplaces an item in the collection. Fires the replace event when complete. Replaces an item in the collection. Fires the replace event when complete. Parameters:key : StringThe key associated with the item to replace, or the replacement item.
- If you supplied a getKey implementation for this MixedCollection, or if the key
-of your stored items is in a property called id, then the MixedCollection
-will be able to derive the key of the replacement item. If you want to replace an item
-with one having the same key value, then just pass the replacement item in this parameter. {Object} : oo (optional) If the first parameter passed was a key, the item to associate
+ Object Replaces an item in the collection. Fires the replace event when complete. Replaces an item in the collection. Fires the replace event when complete.
| MixedCollection |
| resumeEvents()
:
voidResume firing events. (see suspendEvents)
@@ -246,7 +246,7 @@ event... | Observable |
| sort( [String direction ], [Function fn ] )
:
- voidSorts this collection by item value with the passed comparison function. Sorts this collection by item value with the passed comparison function. | MixedCollection |
| suspendEvents( Boolean queueSuspended )
:
voidSuspend the firing of all events. (see resumeEvents) |