1. #1
    Sencha User
    Join Date
    Mar 2010
    Posts
    9
    Vote Rating
    0
    cantorh is on a distinguished road

      0  

    Default 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…
    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
          }
    });
    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.
    -thanks,
    Hugo.
    Last edited by aconran; 6 Feb 2012 at 12:39 PM. Reason: Add code tags.

  2. #2
    Sencha - Architect Dev Team Phil.Strong's Avatar
    Join Date
    Mar 2007
    Location
    Olney, MD
    Posts
    1,898
    Vote Rating
    62
    Phil.Strong is just really nice Phil.Strong is just really nice Phil.Strong is just really nice Phil.Strong is just really nice

      0  

    Default


    Be sure your setting a userClassName (typically I'd suggest the same as storeId).
    Phil Strong
    @philstrong
    #SenchaArchitect
    Sencha Architect Development Team

  3. #3
    Sencha User
    Join Date
    Dec 2011
    Posts
    5
    Vote Rating
    0
    bteixeira is on a distinguished road

      0  

    Default


    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:

    lookup( String/Object store ) : Ext.data.Store

    Gets a registered Store by id
    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').

    So, is this a bug? Or are we doing something wrong?

  4. #4
    Sencha User
    Join Date
    Dec 2011
    Posts
    5
    Vote Rating
    0
    bteixeira is on a distinguished road

      0  

    Default


    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?

Thread Participants: 2