-
6 Feb 2012 12:32 PM #1
storeId not registered
storeId not registered
Hi,
I have a store with a storeId. However, the storeId does not get registered with the StoreManager.
The class name is ‘ReplenishmentOrderStatus2ndSt’ and the storeId is ‘OrderStatus2ndSt'.
Here’s the base class for the store…
At the launch method, store2 will be undefined. Also, if a grid uses the storeId an exception will be thrown because the store will be undefined.Code:Ext.define('PickPack.store.base.ReplenishmentOrderStatus2ndSt', { extend: 'Ext.data.Store', requires: [ ' PickPack.model.ReplenishmentOrderStatus' ], constructor: function(cfg) { var me = this; cfg = cfg || {}; me.callParent([Ext.apply({ storeId: 'OrderStatus2ndSt', model: 'PickPack.model.ReplenishmentOrderStatus' }, cfg)]); } }); The Application is defined as follows.. Ext.application({ models: [ 'ReplenishmentOrderStatus', 'OrdersAssignedToPicking', 'ScanPerformanance' ], stores: [ 'ReplenishmentOrderStatusDayton', 'ScanPerformance2ndSt', 'ScanPerformanceDayton', 'OrdersAssignedToPicking2ndSt', 'OrdersAssignedToPickingDayton', 'ReplenishmentOrderStatus2ndSt' ], views: [ 'MainViewport' ], name: 'PickPack', launch: function() { var store1 = Ext.data.StoreManager.lookup('ReplenishmentOrderStatus2ndSt'); // store1 is set to the store. var store2 = Ext.data.StoreManager.lookup('OrderStatus2ndSt'); // store2 is undefined } });
-thanks,
Hugo.Last edited by aconran; 6 Feb 2012 at 12:39 PM. Reason: Add code tags.
-
7 Feb 2012 8:08 AM #2
Be sure your setting a userClassName (typically I'd suggest the same as storeId).
Phil Strong
@philstrong
#SenchaArchitect
Sencha Architect Development Team
-
15 Feb 2012 5:03 AM #3
Hi there
I have the exact same problem. I can get around it by using lookup with the full class name instead of the storeId.
However, the documentation clearly says:
Instead, it seems the manager is indexing stores by their fully qualified class names, not even their short names. It's kind of annoying having to lookup('long.path.to.my.store.TheStore') instead of lookup('TheStore').lookup( String/Object store ) : Ext.data.Store
Gets a registered Store by id
So, is this a bug? Or are we doing something wrong?
-
15 Feb 2012 6:31 AM #4
Well it seems that if I instantiate the store manually (through a constructor or Ext.create()) the manager maps the store to storeId instead of the full class name. The other situation happens when using the stores[] array. So either this really is a bug or there is some subtlety in the documentation that I haven't found yet.
This is actually not specific to the Designer, could this thread be moved somewhere else?


Reply With Quote