3 <title>The source code</title>
4 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
5 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
7 <body onload="prettyPrint();">
8 <pre class="prettyprint lang-js">/*!
10 * Copyright(c) 2006-2009 Ext JS, LLC
12 * http://www.extjs.com/license
14 <div id="cls-Ext.StoreMgr"></div>/**
16 * @extends Ext.util.MixedCollection
17 * The default global group of stores.
20 Ext.StoreMgr = Ext.apply(new Ext.util.MixedCollection(), {
21 <div id="cfg-Ext.StoreMgr-listeners"></div>/**
22 * @cfg {Object} listeners @hide
25 <div id="method-Ext.StoreMgr-register"></div>/**
26 * Registers one or more Stores with the StoreMgr. You do not normally need to register stores
27 * manually. Any store initialized with a {@link Ext.data.Store#storeId} will be auto-registered.
28 * @param {Ext.data.Store} store1 A Store instance
29 * @param {Ext.data.Store} store2 (optional)
30 * @param {Ext.data.Store} etc... (optional)
32 register : function(){
33 for(var i = 0, s; (s = arguments[i]); i++){
38 <div id="method-Ext.StoreMgr-unregister"></div>/**
39 * Unregisters one or more Stores with the StoreMgr
40 * @param {String/Object} id1 The id of the Store, or a Store instance
41 * @param {String/Object} id2 (optional)
42 * @param {String/Object} etc... (optional)
44 unregister : function(){
45 for(var i = 0, s; (s = arguments[i]); i++){
46 this.remove(this.lookup(s));
50 <div id="method-Ext.StoreMgr-lookup"></div>/**
51 * Gets a registered Store by id
52 * @param {String/Object} id The id of the Store, or a Store instance
53 * @return {Ext.data.Store}
55 lookup : function(id){
57 var fields = ['field1'], expand = !Ext.isArray(id[0]);
59 for(var i = 2, len = id[0].length; i <= len; ++i){
60 fields.push('field' + i);
63 return new Ext.data.ArrayStore({
72 return Ext.isObject(id) ? (id.events ? id : Ext.create(id, 'store')) : this.get(id);
75 // getKey implementation for MixedCollection