Javascript GridPanel作为tabPanel的项
我很难知道我的语法是否正确。另一方面,我理解了如何将GridPanel添加到tabBar项中,我将在下面这样做。在我的App.js中,我定义了一个从ExtJS示例()复制的网格 在下面,我创建了我的应用程序的一个实例:Javascript GridPanel作为tabPanel的项,javascript,sencha-touch,extjs,tabpanel,gridpanel,Javascript,Sencha Touch,Extjs,Tabpanel,Gridpanel,我很难知道我的语法是否正确。另一方面,我理解了如何将GridPanel添加到tabBar项中,我将在下面这样做。在我的App.js中,我定义了一个从ExtJS示例()复制的网格 在下面,我创建了我的应用程序的一个实例: appname.App = Ext.extend(Ext.TabPanel, { fullscreen: true, tabBar: { ui: 'gray', dock: 'bottom', layout: { pack: 'center' } },
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);
}
});
该应用程序通常可以正常加载,但添加了网格
,它会中断,不会加载任何内容
从语法上讲,我应该在应用程序实例化中定义网格,比如A)grid:…
,B)this.grid=new…
,还是C)作为常规的var
命名的grid
非常感谢。Sencha Touch没有内置GridPanel。因此,Ext.grid.GridPanel在这里不起作用。但是,您可以从中使用Simoen的TouchGrid扩展
所有源代码都可用。从较高的层次来看,您的方法似乎没有问题。这两个代码段在同一个js文件中吗?事实上是的。我最好重构。我只是想测试将网格作为选项卡项的实现。您的错误控制台中是否有错误?你能验证网格面板是否真的被创建了吗?它是Sencha Touch应用程序还是ExtJS应用程序?@Swar:它是Sencha Touch(我会修复标签)@乔克雷尔:打得好。我来看看它是否真的被实例化了。
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);
}
});