【问题标题】:EXTJS4: Combobox Store in View throws errorEXTJS4:视图中的组合框存储引发错误
【发布时间】:2013-06-11 02:41:22
【问题描述】:

我的视图中有一个普通的 Combobox,我想加载商店,但随后我的 Firebug 中出现错误: TypeError: reader.read 不是函数 结果 = reader.read(me.extractResponseData(response));

我认为的部分:

{
        xtype: 'combobox',
        id:'newsletter_template',
        fields: ['groupValue','groupText'],
        name:'template',
        editable:false,
        valueField: 'groupValue',
        displayField: 'groupText',
        allowBlank: false,
        fieldLabel: 'Template',
        anchor: '100%',
        emptyText: 'Choose Template',
        store: Ext.create('Ext.data.ArrayStore', {
            model: 'news',
            controller: 'news',
            proxy: {
                type: 'ajax',
                url: 'bin/news/ajax.php',
                reader: {
                    type: 'json',
                    root: 'results'
                },
                extraParams:{
                    action:'getNewsTemplates'
                }
            },
            callback: function(records, operation, success) {
            // do something after the load finishes
            },
            autoLoad: false
        })

    }

有人知道吗?非常感谢!!!

【问题讨论】:

    标签: combobox extjs4 store


    【解决方案1】:

    尝试更改store: Ext.create('Ext.data.ArrayStore', {store: Ext.create('Ext.data.Store', {

    问题是您使用的是一个 ArrayStore,它基本上是一个已经定义了数组读取器的常规存储,然后您在其中定义了一个没有任何意义的 json 读取器。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-03-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-09
      相关资源
      最近更新 更多