本文介绍了GridPanel作为tabPanel的项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在语法上是否知道此设置正确时遇到麻烦.从另一个线程中,我了解了将GridPanel添加到tabBar项的方法,如下所示.在我的App.js中,我定义了一个从ExtJS示例复制的网格(此处).

I'm having trouble knowing if I syntactically have this setup right. From another thread, I understand to add the GridPanel to the tabBar items, which I do so below. In my App.js, I define a grid copied from the ExtJS example (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
});

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

Below that, I create an instance of my app:

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后,它会崩溃并且没有任何加载.

The app normally loads just fine, but with the addition of grid, it breaks and nothing loads.

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

Syntactically, should I be defining grid inside the app instantiation like A) grid: ..., B) this.grid = new ..., or C) as I have it as a regular var named grid?

非常感谢.

推荐答案

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

There is no inbuilt GridPanel comes with Sencha Touch. So, that Ext.grid.GridPanel will not work here. However, you can use Simoen's TouchGrid extension from here.

所有源代码都可以在此处使用.

All the source codes are available here.

这篇关于GridPanel作为tabPanel的项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-18 21:16