PDA

View Full Version : A question about storeId and StoreMgr



feiq
17 Mar 2011, 7:45 PM
When I create a subclass of a Store with a property: storeId :'xxx'. Is it meas that the substore just have only one instance? For example:
I hava a Store defined like this.


EnumDictionaryStore = Ext.extend(Ext.data.JsonStore, {
constructor : function(cfg) {
cfg = cfg || {};
EnumDictionaryStore.superclass.constructor.call(this, Ext.apply({
storeId : 'EnumDictionaryStore',
url : 'EnumDictionary/ListByCategory',
root : 'result',
fields : [{
name : 'EnumDictionaryID'
}, {
name : 'Display'
}, {
name : 'Value'
}]
}, cfg));
}
});

new EnumDictionaryStore()

When I init a EnumDictionaryStore for some comboboxes or other widgets, the widtgets use the same instance defined in the code. I think the resion is that once storeId is applied to substore class, it will be managed by StoreMgr, when I want to new the substore, it will lookup from StoreMgr, so we always get just one substore instance.
But now I want to init some combobox with a new instance, how should I do? Thanks.