getStore(); undefined Sencha Touch 2

Prometheus

I have 2 stores with loaded 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 works;

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

But when I change the storeId to 'Secondgroup'(in getStore) my console.log will give me an 'undefined'..

I can't seem the find the problem.. any suggestions in what direction I have to look?

PS. I am using Sencha Architect, but that shouldn't be a problem.

arleslie

Sencha Touch actually uses what you used in the define.

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

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

getStore(); 未定义的Sencha Touch 2

来自分类Dev

getStore(); 未定义的Sencha Touch 2

来自分类Dev

Sencha Touch:Ext.getStore和Ext.getStore.load

来自分类Dev

推送通知Sencha Touch 2

来自分类Dev

Sencha Touch 2 painted event not firing

来自分类Dev

Sencha touch 2:更改框架源

来自分类Dev

Sencha Touch 2绘制事件未触发

来自分类Dev

贝宝的sencha touch 2和phonegap

来自分类Dev

在sencha touch 2中解析嵌套的XML

来自分类Dev

Sencha Touch 2 App FieldSet无法呈现

来自分类Dev

带有Sencha Touch 2的CORS

来自分类Dev

在Sencha Touch 2中排列组件

来自分类Dev

Sencha Touch 2:Webstorm Run配置

来自分类Dev

Sencha Touch 2饼图未显示

来自分类Dev

Sencha Touch 2布局:适合内部内容

来自分类Dev

推迟TabPanel渲染sencha touch 2

来自分类Dev

Sencha touch 2无法使Ajax呼叫正常工作

来自分类Dev

在Sencha Touch 2中动态设置面板属性

来自分类Dev

如何从sencha touch 2请求中删除_dc参数

来自分类Dev

Sencha Touch 2:构建应用后面板不会滚动

来自分类Dev

Sencha Touch 2:扩展消息显示并点按任意位置以隐藏

来自分类Dev

如何在Sencha Touch2中显示数据视图?

来自分类Dev

使用sencha touch 2在phonegap 2.9.0中未触发deviceready

来自分类Dev

使用Sencha Touch 2 MVC解析JSON不起作用

来自分类Dev

谷歌地图的sencha touch 2实现(MVC方式)

来自分类Dev

无法在TabPanel Sencha Touch 2中显示TabPanel

来自分类Dev

从Sencha Touch 2列表中获取列表项

来自分类Dev

Sencha Touch 2饼图没有标签

来自分类Dev

json中的sencha touch 2工具栏标题