X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/7a654f8d43fdb43d78b63d90528bed6e86b608cc..3789b528d8dd8aad4558e38e22d775bcab1cbd36:/docs/source/AbstractMixedCollection.html diff --git a/docs/source/AbstractMixedCollection.html b/docs/source/AbstractMixedCollection.html index 4d73a0be..07285fd8 100644 --- a/docs/source/AbstractMixedCollection.html +++ b/docs/source/AbstractMixedCollection.html @@ -1,4 +1,21 @@ -
/**
+
+
+
+
+ The source code
+
+
+
+
+
+
+ /**
* @class Ext.util.AbstractMixedCollection
*/
Ext.define('Ext.util.AbstractMixedCollection', {
@@ -17,13 +34,13 @@ Ext.define('Ext.util.AbstractMixedCollection', {
me.length = 0;
me.addEvents(
- /**
+ /**
* @event clear
* Fires when the collection is cleared.
*/
'clear',
- /**
+ /**
* @event add
* Fires when an item is added to the collection.
* @param {Number} index The index at which the item was added.
@@ -32,7 +49,7 @@ Ext.define('Ext.util.AbstractMixedCollection', {
*/
'add',
- /**
+ /**
* @event replace
* Fires when an item is replaced in the collection.
* @param {String} key he key associated with the new added.
@@ -41,7 +58,7 @@ Ext.define('Ext.util.AbstractMixedCollection', {
*/
'replace',
- /**
+ /**
* @event remove
* Fires when an item is removed from the collection.
* @param {Object} o The item being removed.
@@ -59,14 +76,14 @@ Ext.define('Ext.util.AbstractMixedCollection', {
me.mixins.observable.constructor.call(me);
},
- /**
+ /**
* @cfg {Boolean} allowFunctions Specify <tt>true</tt> if the {@link #addAll}
* function should add function references to the collection. Defaults to
* <tt>false</tt>.
*/
allowFunctions : false,
- /**
+ /**
* Adds an item to the collection. Fires the {@link #add} event when complete.
* @param {String} key <p>The key to associate with the item, or the new item.</p>
* <p>If a {@link #getKey} implementation was specified for this MixedCollection,
@@ -100,7 +117,7 @@ Ext.define('Ext.util.AbstractMixedCollection', {
return myObj;
},
- /**
+ /**
* MixedCollection has a generic way to fetch keys if you implement getKey. The default implementation
* simply returns <b><code>item.id</code></b> but you can provide your own implementation
* to return a different value as in the following examples:<pre><code>
@@ -132,7 +149,7 @@ mc.add(otherEl);
return o.id;
},
- /**
+ /**
* Replaces an item in the collection. Fires the {@link #replace} event when complete.
* @param {String} key <p>The key associated with the item to replace, or the replacement item.</p>
* <p>If you supplied a {@link #getKey} implementation for this MixedCollection, or if the key
@@ -163,7 +180,7 @@ mc.add(otherEl);
return o;
},
- /**
+ /**
* Adds all elements of an Array or an Object to the collection.
* @param {Object/Array} objs An Object containing properties which will be added
* to the collection, or an Array of values, each of which are added to the collection.
@@ -193,7 +210,7 @@ mc.add(otherEl);
}
},
- /**
+ /**
* Executes the specified function once for every item in the collection, passing the following arguments:
* <div class="mdetail-params"><ul>
* <li><b>item</b> : Mixed<p class="sub-desc">The collection item</p></li>
@@ -218,7 +235,7 @@ mc.add(otherEl);
}
},
- /**
+ /**
* Executes the specified function once for every key in the collection, passing each
* key, and its associated item as the first two parameters.
* @param {Function} fn The function to execute for each item.
@@ -235,7 +252,7 @@ mc.add(otherEl);
}
},
- /**
+ /**
* Returns the first item in the collection which elicits a true return value from the
* passed selection function.
* @param {Function} fn The selection function to execute for each item.
@@ -265,7 +282,7 @@ mc.add(otherEl);
},
//</deprecated>
- /**
+ /**
* Inserts an item at the specified index in the collection. Fires the {@link #add} event when complete.
* @param {Number} index The index to insert the item at.
* @param {String} key The key to associate with the new item, or the item itself.
@@ -299,7 +316,7 @@ mc.add(otherEl);
return myObj;
},
- /**
+ /**
* Remove an item from the collection.
* @param {Object} o The item to remove.
* @return {Object} The item removed or false if no item was removed.
@@ -308,7 +325,7 @@ mc.add(otherEl);
return this.removeAt(this.indexOf(o));
},
- /**
+ /**
* Remove all items in the passed array from the collection.
* @param {Array} items An array of items to be removed.
* @return {Ext.util.MixedCollection} this object
@@ -321,7 +338,7 @@ mc.add(otherEl);
return this;
},
- /**
+ /**
* Remove an item from a specified index in the collection. Fires the {@link #remove} event when complete.
* @param {Number} index The index within the collection of the item to remove.
* @return {Object} The item removed or false if no item was removed.
@@ -346,7 +363,7 @@ mc.add(otherEl);
return false;
},
- /**
+ /**
* Removed an item associated with the passed key fom the collection.
* @param {String} key The key of the item to remove.
* @return {Object} The item removed or false if no item was removed.
@@ -355,7 +372,7 @@ mc.add(otherEl);
return this.removeAt(this.indexOfKey(key));
},
- /**
+ /**
* Returns the number of items in the collection.
* @return {Number} the number of items in the collection.
*/
@@ -363,7 +380,7 @@ mc.add(otherEl);
return this.length;
},
- /**
+ /**
* Returns index within the collection of the passed Object.
* @param {Object} o The item to find the index of.
* @return {Number} index of the item. Returns -1 if not found.
@@ -372,7 +389,7 @@ mc.add(otherEl);
return Ext.Array.indexOf(this.items, o);
},
- /**
+ /**
* Returns index within the collection of the passed key.
* @param {String} key The key to find the index of.
* @return {Number} index of the key.
@@ -381,7 +398,7 @@ mc.add(otherEl);
return Ext.Array.indexOf(this.keys, key);
},
- /**
+ /**
* Returns the item associated with the passed key OR index.
* Key has priority over index. This is the equivalent
* of calling {@link #key} first, then if nothing matched calling {@link #getAt}.
@@ -396,7 +413,7 @@ mc.add(otherEl);
return typeof item != 'function' || me.allowFunctions ? item : null; // for prototype!
},
- /**
+ /**
* Returns the item at the specified index.
* @param {Number} index The index of the item.
* @return {Object} The item at the specified index.
@@ -405,7 +422,7 @@ mc.add(otherEl);
return this.items[index];
},
- /**
+ /**
* Returns the item associated with the passed key.
* @param {String/Number} key The key of the item.
* @return {Object} The item associated with the passed key.
@@ -414,7 +431,7 @@ mc.add(otherEl);
return this.map[key];
},
- /**
+ /**
* Returns true if the collection contains the passed Object as an item.
* @param {Object} o The Object to look for in the collection.
* @return {Boolean} True if the collection contains the Object as an item.
@@ -423,7 +440,7 @@ mc.add(otherEl);
return Ext.Array.contains(this.items, o);
},
- /**
+ /**
* Returns true if the collection contains the passed Object as a key.
* @param {String} key The key to look for in the collection.
* @return {Boolean} True if the collection contains the Object as a key.
@@ -432,7 +449,7 @@ mc.add(otherEl);
return typeof this.map[key] != 'undefined';
},
- /**
+ /**
* Removes all items from the collection. Fires the {@link #clear} event when complete.
*/
clear : function(){
@@ -445,7 +462,7 @@ mc.add(otherEl);
me.fireEvent('clear');
},
- /**
+ /**
* Returns the first item in the collection.
* @return {Object} the first item in the collection..
*/
@@ -453,7 +470,7 @@ mc.add(otherEl);
return this.items[0];
},
- /**
+ /**
* Returns the last item in the collection.
* @return {Object} the last item in the collection..
*/
@@ -461,7 +478,7 @@ mc.add(otherEl);
return this.items[this.length - 1];
},
- /**
+ /**
* Collects all of the values of the given property and returns their sum
* @param {String} property The property to sum by
* @param {String} root Optional 'root' property to extract the first argument from. This is used mainly when
@@ -486,7 +503,7 @@ mc.add(otherEl);
return sum;
},
- /**
+ /**
* Collects unique values of a particular property in this MixedCollection
* @param {String} property The property to collect on
* @param {String} root Optional 'root' property to extract the first argument from. This is used mainly when
@@ -514,7 +531,7 @@ mc.add(otherEl);
return unique;
},
- /**
+ /**
* @private
* Extracts all of the given property values from the items in the MC. Mainly used as a supporting method for
* functions like sum and collect.
@@ -533,7 +550,7 @@ mc.add(otherEl);
return Ext.Array.pluck(values, property);
},
- /**
+ /**
* Returns a range of items in this collection
* @param {Number} startIndex (optional) The starting index. Defaults to 0.
* @param {Number} endIndex (optional) The ending index. Defaults to the last item.
@@ -563,7 +580,7 @@ mc.add(otherEl);
return range;
},
- /**
+ /**
* <p>Filters the objects in this collection by a set of {@link Ext.util.Filter Filter}s, or by a single
* property/value pair with optional parameters for substring matching and case sensitivity. See
* {@link Ext.util.Filter Filter} for an example of using Filter objects (preferred). Alternatively,
@@ -627,7 +644,7 @@ var middleAged = people.filter('age', 24);
return this.filterBy(filterFn);
},
- /**
+ /**
* Filter by a function. Returns a <i>new</i> 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.
@@ -654,7 +671,7 @@ var middleAged = people.filter('age', 24);
return newMC;
},
- /**
+ /**
* Finds the index of the first matching object in this collection by a specific property/value.
* @param {String} property The name of a property on your objects.
* @param {String/RegExp} value A string that the property values
@@ -674,7 +691,7 @@ var middleAged = people.filter('age', 24);
}, null, start);
},
- /**
+ /**
* Find the index of the first matching object in this collection by a function.
* If the function returns <i>true</i> it is considered a match.
* @param {Function} fn The function to be called, it will receive the args o (the object), k (the key).
@@ -697,7 +714,7 @@ var middleAged = people.filter('age', 24);
return -1;
},
- /**
+ /**
* Returns a regular expression based on the given value and matching options. This is used internally for finding and filtering,
* and by Ext.data.Store#filter
* @private
@@ -724,7 +741,7 @@ var middleAged = people.filter('age', 24);
return value;
},
- /**
+ /**
* Creates a shallow copy of this collection
* @return {MixedCollection}
*/
@@ -743,4 +760,6 @@ var middleAged = people.filter('age', 24);
return copy;
}
});
-
\ No newline at end of file
+
+
+