forked from fanruan/fineui
Browse Source
* commit '73a3ca9e99ca7f775ba28134d7124af51ae1e094': models and stores models and storeses6
guy
7 years ago
6 changed files with 161 additions and 21 deletions
File diff suppressed because one or more lines are too long
@ -0,0 +1,15 @@
|
||||
;(function () { |
||||
var models = {}; |
||||
BI.models = function (xtype, cls) { |
||||
if (models[xtype] != null) { |
||||
throw ("models:[" + xtype + "] has been registed"); |
||||
} |
||||
models[xtype] = cls; |
||||
}; |
||||
|
||||
BI.Models = { |
||||
getModel: function (type, config) { |
||||
return new models[type](config); |
||||
} |
||||
} |
||||
})(); |
@ -0,0 +1,20 @@
|
||||
;(function () { |
||||
var kv = {}; |
||||
BI.stores = function (xtype, cls) { |
||||
if (kv[xtype] != null) { |
||||
throw ("stores:[" + xtype + "] has been registed"); |
||||
} |
||||
kv[xtype] = cls; |
||||
}; |
||||
|
||||
var stores = {}; |
||||
|
||||
BI.Stores = { |
||||
getStore: function (type, config) { |
||||
if (stores[type]) { |
||||
return stores[type]; |
||||
} |
||||
return stores[type] = new kv[type](config); |
||||
} |
||||
} |
||||
})(); |
Loading…
Reference in new issue