GetStore (); undefined Sencha Touch 2

I have 2 stores with uploaded data.

First store:

Ext.define('Connecting.store.Groups', {
    extend: 'Ext.data.Store',

    requires: [
        'Connecting.model.groupModel',
        'Ext.data.proxy.Ajax',
        'Ext.data.reader.Json'
    ],

    config: {
        autoLoad: true,
        model: 'Connecting.model.groupModel',
        storeId: 'Groups',
        proxy: {
            type: 'ajax',
            url: 'http://localhost/php/getGroups.php',
            reader: {

                    type: 'json'
                }
            }
        }
    });

Second store:

Ext.define('Connecting.store.Secondgroups', {
    extend: 'Ext.data.Store',

    requires: [
        'Connecting.model.Secondgroup',
        'Ext.data.proxy.Ajax',
        'Ext.data.reader.Json'
    ],

    config: {
        autoLoad: true,
        model: 'Connecting.model.Secondgroup',
        storeId: 'Secondgroup',
        proxy: {
            type: 'ajax',
            url: 'http://localhost/php/getSecondGroup.php',
            reader: {
                type: 'json'
            }
        }
    }
});

The first store is open;

 var store = Ext.getStore('Groups');
 console.log(store);

But when I change storeIdto ' Secondgroup' (in getStore), mine console.logwill give me 'undefined'..

I can not find the problem. Any suggestions in which direction I need to look?

PS. I am using Sencha Architect, but this should not be a problem.

+4
source share
1 answer

Sencha Touch actually uses what you used in the definition.

For the second group, try using Ext.getStore ('Secondgroups'); and that should work for you.

+4
source

All Articles