81 lines
2.7 KiB
HTML
81 lines
2.7 KiB
HTML
<!DOCTYPE html>
|
|
<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>
|
|
<style type="text/css">
|
|
.highlight { display: block; background-color: #ddd; }
|
|
</style>
|
|
<script type="text/javascript">
|
|
function highlight() {
|
|
document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
|
|
}
|
|
</script>
|
|
</head>
|
|
<body onload="prettyPrint(); highlight();">
|
|
<pre class="prettyprint lang-js"><span id='Ext-StoreMgr'>/**
|
|
</span> * @class Ext.StoreMgr
|
|
* @extends Ext.util.MixedCollection
|
|
* The default global group of stores.
|
|
* @singleton
|
|
*/
|
|
Ext.StoreMgr = Ext.apply(new Ext.util.MixedCollection(), {
|
|
<span id='Ext-StoreMgr-cfg-listeners'> /**
|
|
</span> * @cfg {Object} listeners @hide
|
|
*/
|
|
|
|
<span id='Ext-StoreMgr-method-register'> /**
|
|
</span> * 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...} stores Any number of Store instances
|
|
*/
|
|
register : function(){
|
|
for(var i = 0, s; (s = arguments[i]); i++){
|
|
this.add(s);
|
|
}
|
|
},
|
|
|
|
<span id='Ext-StoreMgr-method-unregister'> /**
|
|
</span> * Unregisters one or more Stores with the StoreMgr
|
|
* @param {String/Object} ids IDs of the Stores, or Store instances
|
|
*/
|
|
unregister : function(){
|
|
for(var i = 0, s; (s = arguments[i]); i++){
|
|
this.remove(this.lookup(s));
|
|
}
|
|
},
|
|
|
|
<span id='Ext-StoreMgr-method-lookup'> /**
|
|
</span> * 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>
|