1

我无法知道我在语法上是否正确设置了此设置。从另一个线程,我了解将 GridPanel 添加到 tabBar 项目,我在下面这样做。在我的 App.js 中,我定义了一个从 ExtJS 示例(此处)复制的网格。

var grid = new Ext.grid.GridPanel({
    // Details can be seen at
    // http://dev.sencha.com/deploy/ext-3.4.0/docs/?class=Ext.Component?class=Ext.grid.GridPanel
});

在此之下,我创建了我的应用程序的一个实例:

appname.App = Ext.extend(Ext.TabPanel, {

fullscreen: true,

tabBar: {
    ui: 'gray',
    dock: 'bottom',
    layout: { pack: 'center' }
},

cardSwitchAnimation: false,

initComponent: function() {

    if (navigator.onLine) {

        // Add items to the tabPanel
        this.items = [{
            title: 'Tab 1',
            iconCls: 'tab1',
            xtype: 'tab1',
            pages: this.accountPages
        }, {
            title: 'Tab 2',
            iconCls: 'tab2',
            xtype: 'tab2',
            pages: this.accountPages
        },
        grid];
    } else {
        this.on('render', function(){
            this.el.mask('No internet connection.');
        }, this);
    }

    appname.App.superclass.initComponent.call(this);
}

});

该应用程序通常可以正常加载,但是添加 后grid,它会中断并且没有加载。

从语法上讲,我是否应该在应用程序实例化中定义网格,如 A) grid: ...、 B)this.grid = new ...或 C) ,因为我将其作为常规var命名grid

非常感谢。

4

1 回答 1

2

Sencha Touch 没有内置的 GridPanel。所以,Ext.grid.GridPanel 在这里不起作用。但是,您可以从此处使用 Simoen 的 TouchGrid 扩展。

所有的源代码都可以在这里找到

于 2011-06-25T12:03:41.503 回答