Results 1 to 3 of 3

Thread: Store is undefined

  1. #1

    Default Store is undefined

    I'm creating a simple store in coffeescript but it returns as undefined when I call it in the browser console `Ext.getStore('visitors')`


    Code:
        Ext.define 'heroico.store.Visitors',
            extend: 'Ext.data.Store'
            model: 'heroico.model.Visitor'
            storeId: 'visitors'
    If I create it without actually extending `'Ext.data.Store'` I can find it via `getStore` method but then I can't load it in my controller in the `stores` array:


    Code:
        Ext.create 'Ext.data.Store',
            model: 'heroico.model.Visitor'
            storeId: 'visitors'
    Any idea why it would behave this way?

  2. #2

    Default

    It seems there is a bug with Ext.getStore (http://docs.sencha.com/extjs/4.2.2/#...-method-lookup) which returns undefined if Ex.create was not used and, since i'm using Ext.define, I can't load my store. Is there a way around this?

  3. #3
    Sencha User carol.ext's Avatar
    Join Date
    Jun 2007
    Location
    Littleton, Colorado, USA
    Posts
    708

    Default

    Ext.define does not create an instance of your store. You still need to either use new, Ext.create, or specify the type/storeId on something like a grid to end up with an instance.

    Ext.create

    New vs. Ext.create

    Ext.grid.Panel store config - see slemmon comment

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •