- 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.
+ * @param {Function} fn The function to execute.
+ * @param {String} fn.key The key of the item
+ * @param {Number} fn.value The value of the item
+ * @param {Number} fn.length The total number of items in the collection
+ * @param {Boolean} fn.return False to cease iteration.
+ * @param {Object} scope The scope to execute in. Defaults to `this`.
+ */
+ 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();