3 <title>The source code</title>
\r
4 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
\r
5 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
\r
7 <body onload="prettyPrint();">
\r
8 <pre class="prettyprint lang-js"><div id="cls-Ext.StoreMgr"></div>/**
10 * @extends Ext.util.MixedCollection
11 * The default global group of stores.
14 Ext.StoreMgr = Ext.apply(new Ext.util.MixedCollection(), {
15 <div id="cfg-Ext.StoreMgr-listeners"></div>/**
16 * @cfg {Object} listeners @hide
19 <div id="method-Ext.StoreMgr-register"></div>/**
20 * Registers one or more Stores with the StoreMgr. You do not normally need to register stores
21 * manually. Any store initialized with a {@link Ext.data.Store#storeId} will be auto-registered.
22 * @param {Ext.data.Store} store1 A Store instance
23 * @param {Ext.data.Store} store2 (optional)
24 * @param {Ext.data.Store} etc... (optional)
26 register : function(){
27 for(var i = 0, s; (s = arguments[i]); i++){
32 <div id="method-Ext.StoreMgr-unregister"></div>/**
33 * Unregisters one or more Stores with the StoreMgr
34 * @param {String/Object} id1 The id of the Store, or a Store instance
35 * @param {String/Object} id2 (optional)
36 * @param {String/Object} etc... (optional)
38 unregister : function(){
39 for(var i = 0, s; (s = arguments[i]); i++){
40 this.remove(this.lookup(s));
44 <div id="method-Ext.StoreMgr-lookup"></div>/**
45 * Gets a registered Store by id
46 * @param {String/Object} id The id of the Store, or a Store instance
47 * @return {Ext.data.Store}
49 lookup : function(id){
51 var fields = ['field1'], expand = !Ext.isArray(id[0]);
53 for(var i = 2, len = id[0].length; i <= len; ++i){
54 fields.push('field' + i);
57 return new Ext.data.ArrayStore({
66 return Ext.isObject(id) ? (id.events ? id : Ext.create(id, 'store')) : this.get(id);
69 // getKey implementation for MixedCollection