【问题标题】:Sencha Touch 2 cannot read property of undefined (amfphp2)Sencha Touch 2 无法读取 undefined (amfphp2) 的属性
【发布时间】:2012-12-24 18:27:50
【问题描述】:

我想创建一个包含商店和模型的嵌套列表。 我的商店在不同的文件中,我的 model.js 也是如此。

当心我正在使用 amfPHP => 2 !

当我将我的商店“eventStore”称为“商店:App.stores.eventStore”时,我收到以下错误:

未捕获的类型错误:无法读取未定义的属性“eventStore”

我的店铺代码是这样的:

App.stores.eventStore = new Ext.data.TreeStore({
    model: 'Events',
    proxy: {
        type: 'ajax',
        params: JSON.stringify(
            {serviceName: 'EventService',
            methodName: 'getEvents'}),
        url: 'http://localhost/amfphp/Amfphp/?contentType=application/json',
        reader: {
            type: 'tree',
            root: 'items'
        }
    }
});

知道我的错误是什么吗?

(EventService.php运行正常,在amfphp的网关浏览器中测试过)

提前谢谢!

【问题讨论】:

    标签: extjs touch amfphp


    【解决方案1】:

    您尝试分配对象 App.Stores 的值,但未定义。也许那是你的命名空间?然后定义它:

    Ext.ns("App.stores");
    

    【讨论】:

      猜你喜欢
      • 2014-01-25
      • 1970-01-01
      • 2017-04-01
      • 1970-01-01
      • 1970-01-01
      • 2018-02-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多