- all.on("add", function(index, o){
- if (o.id == id) {
- fn.call(scope || o, o);
- all.un("add", fn, scope);
- }
- });
+ if (all.containsKey(id)) {
+ item = all.get(id);
+ fn.call(scope || item, item);
+ } else {
+ all.on('add', function(map, key, item){
+ if (key == id) {
+ fn.call(scope || item, item);
+ all.un('add', fn, scope);
+ }
+ });
+ }
+ },
+
+<span id='Ext-AbstractManager-method-each'> /**
+</span> * Executes the specified function once for each item in the collection.
+ * Returning false from the function will cease iteration.
+ *
+ * The paramaters passed to the function are:
+ * <div class="mdetail-params"><ul>
+ * <li><b>key</b> : String<p class="sub-desc">The key of the item</p></li>
+ * <li><b>value</b> : Number<p class="sub-desc">The value of the item</p></li>
+ * <li><b>length</b> : Number<p class="sub-desc">The total number of items in the collection</p></li>
+ * </ul></div>
+ * @param {Object} fn The function to execute.
+ * @param {Object} scope The scope to execute in. Defaults to <tt>this</tt>.
+ */
+ each: function(fn, scope){
+ this.all.each(fn, scope || this);
+ },
+
+<span id='Ext-AbstractManager-method-getCount'> /**
+</span> * Gets the number of items in the collection.
+ * @return {Number} The number of items in the collection.
+ */
+ getCount: function(){
+ return this.all.getCount();