【问题标题】:Cannot read property 'features' of undefined when use Ext.ux.touch.grid使用 Ext.ux.touch.grid 时无法读取未定义的属性“功能”
【发布时间】:2013-08-07 11:24:35
【问题描述】:

当我使用 Ext.ux.touch.grid 时,发生了错误?

“无法读取未定义的属性‘特征’”

但只有当我这样使用它时才会发生,

this.testGrid = Ext.create('Geo.view.Grid');

在 application.js 文件中,一个主控制器文件

config: {
   refs: {
        main: 'mainview',
        worklist: 'worklist',
        testGrid: 'testGrid'
    },

这是 testGrid 视图文件

Ext.define('Geo.view.Grid', {
    extend : 'Ext.ux.touch.grid.List',
    xtype  : 'testGrid',

    requires : [
        'Ext.ux.touch.grid.feature.Feature',
        'Ext.ux.touch.grid.feature.Editable',
        'Ext.ux.touch.grid.feature.Sorter',
        'Ext.field.Number',
        'Geo.store.Grid'
    ],

    config : {
        title    : 'Grid',
        store    : true,
        columns  : [
            {
                header    : 'Text',
                dataIndex : 'text',
                width     : '90%',
                editor    : {
                    xtype  : 'textfield'
                }
            },
            {
                header    : 'Amount',
                dataIndex : 'amount',
                width     : '10%',
                editor    : {
                    xtype  : 'numberfield'
                }
            }
        ],
        features : [
            {
                ftype    : 'Ext.ux.touch.grid.feature.Sorter',
                launchFn : 'initialize'
            },
            {
                ftype    : 'Ext.ux.touch.grid.feature.Editable',
                launchFn : 'initialize'
            }
        ]
    },

    applyStore : function() {
        return new Geo.store.Grid();
    }
});

直接在主视图文件中使用时正确

 items: [
     {xtype: 'dashboards'},
     {xtype: 'testGrid'}
 ]

谁知道原因?非常感谢

【问题讨论】:

    标签: grid sencha-touch-2 extjs4.1


    【解决方案1】:

    您是否将商店设置为自动加载:true, (?)

    【讨论】:

      猜你喜欢
      • 2018-12-05
      • 2020-05-18
      • 2017-05-08
      • 1970-01-01
      • 2021-07-15
      • 2020-07-03
      • 1970-01-01
      • 1970-01-01
      • 2015-10-21
      相关资源
      最近更新 更多