1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
|
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>The source code</title>
<link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="../resources/prettify/prettify.js"></script>
</head>
<body onload="prettyPrint();">
<pre class="prettyprint lang-js">/*!
* Ext JS Library 3.4.0
* Copyright(c) 2006-2011 Sencha Inc.
* licensing@sencha.com
* http://www.sencha.com/license
*/
<div id="cls-Ext.StoreMgr"></div>/**
* @class Ext.StoreMgr
* @extends Ext.util.MixedCollection
* The default global group of stores.
* @singleton
*/
Ext.StoreMgr = Ext.apply(new Ext.util.MixedCollection(), {
<div id="cfg-Ext.StoreMgr-listeners"></div>/**
* @cfg {Object} listeners @hide
*/
<div id="method-Ext.StoreMgr-register"></div>/**
* Registers one or more Stores with the StoreMgr. You do not normally need to register stores
* manually. Any store initialized with a {@link Ext.data.Store#storeId} will be auto-registered.
* @param {Ext.data.Store} store1 A Store instance
* @param {Ext.data.Store} store2 (optional)
* @param {Ext.data.Store} etc... (optional)
*/
register : function(){
for(var i = 0, s; (s = arguments[i]); i++){
this.add(s);
}
},
<div id="method-Ext.StoreMgr-unregister"></div>/**
* Unregisters one or more Stores with the StoreMgr
* @param {String/Object} id1 The id of the Store, or a Store instance
* @param {String/Object} id2 (optional)
* @param {String/Object} etc... (optional)
*/
unregister : function(){
for(var i = 0, s; (s = arguments[i]); i++){
this.remove(this.lookup(s));
}
},
<div id="method-Ext.StoreMgr-lookup"></div>/**
* Gets a registered Store by id
* @param {String/Object} id The id of the Store, or a Store instance
* @return {Ext.data.Store}
*/
lookup : function(id){
if(Ext.isArray(id)){
var fields = ['field1'], expand = !Ext.isArray(id[0]);
if(!expand){
for(var i = 2, len = id[0].length; i <= len; ++i){
fields.push('field' + i);
}
}
return new Ext.data.ArrayStore({
fields: fields,
data: id,
expandData: expand,
autoDestroy: true,
autoCreated: true
});
}
return Ext.isObject(id) ? (id.events ? id : Ext.create(id, 'store')) : this.get(id);
},
// getKey implementation for MixedCollection
getKey : function(o){
return o.storeId;
}
});</pre>
</body>
</html>
|