3 * Copyright(c) 2006-2009 Ext JS, LLC
5 * http://www.extjs.com/license
9 * @extends Ext.util.MixedCollection
10 * The default global group of stores.
13 Ext.StoreMgr = Ext.apply(new Ext.util.MixedCollection(), {
15 * @cfg {Object} listeners @hide
19 * Registers one or more Stores with the StoreMgr. You do not normally need to register stores
20 * manually. Any store initialized with a {@link Ext.data.Store#storeId} will be auto-registered.
21 * @param {Ext.data.Store} store1 A Store instance
22 * @param {Ext.data.Store} store2 (optional)
23 * @param {Ext.data.Store} etc... (optional)
25 register : function(){
26 for(var i = 0, s; (s = arguments[i]); i++){
32 * Unregisters one or more Stores with the StoreMgr
33 * @param {String/Object} id1 The id of the Store, or a Store instance
34 * @param {String/Object} id2 (optional)
35 * @param {String/Object} etc... (optional)
37 unregister : function(){
38 for(var i = 0, s; (s = arguments[i]); i++){
39 this.remove(this.lookup(s));
44 * Gets a registered Store by id
45 * @param {String/Object} id The id of the Store, or a Store instance
46 * @return {Ext.data.Store}
48 lookup : function(id){
50 var fields = ['field1'], expand = !Ext.isArray(id[0]);
52 for(var i = 2, len = id[0].length; i <= len; ++i){
53 fields.push('field' + i);
56 return new Ext.data.ArrayStore({
65 return Ext.isObject(id) ? (id.events ? id : Ext.create(id, 'store')) : this.get(id);
68 // getKey implementation for MixedCollection