javascript - GridPanel 作为 tabPanel 的项目

标签 javascript sencha-touch extjs tabpanel gridpanel

我无法确定我的语法设置是否正确。来自另一个thread ,我明白要将 GridPanel 添加到 tabBar 项目,我在下面这样做。在我的 App.js 中,我定义了一个从 ExtJS 示例 (here) 复制的网格。

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 这样在应用程序实例化中定义网格吗? ) 因为我将它作为一个名为 grid 的常规 var?

非常感谢。

最佳答案

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

所有源代码都可用here .

关于javascript - GridPanel 作为 tabPanel 的项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6460266/

相关文章:

javascript - 如何以正确的方式加载 css 异步?

javascript - 在升序和降序多维数组之间切换

javascript - sencha 触摸过滤器商店列表?

filter - Sencha Touch 过滤器 ListView 数据存储

javascript - Sencha Touch ExtJS 添加复选框列表

javascript - Snap.SVG 中的 Clone() 随机失败

javascript - while(1) 在 JavaScript 中

sencha-touch - 如何在 Sencha Touch 中使文本字段不可编辑

sencha-touch - 在 Sencha Touch 2 搜索列表中需要帮助

android - 如何在 Sencha Touch 2 中制作签名的 APK