Javascript ExtJs工具栏配置对象
所以我有下面的场景 在我的主要观点中,我有这样一个容器:Javascript ExtJs工具栏配置对象,javascript,extjs,Javascript,Extjs,所以我有下面的场景 在我的主要观点中,我有这样一个容器: Ext.define('APP.view.main.Main', { extend: 'Ext.container.Container', xtype: 'app-main', id: 'root', requires: [ 'Ext.menu.*' ], items:[ 'APP.view.main.topBar' ] }); Ext.define('APP.view.main.topBar',{ exten
Ext.define('APP.view.main.Main', {
extend: 'Ext.container.Container',
xtype: 'app-main',
id: 'root',
requires: [
'Ext.menu.*'
],
items:[
'APP.view.main.topBar'
]
});
Ext.define('APP.view.main.topBar',{
extend: 'Ext.container.Container',
docked: 'top',
xtype: 'toolbar',
id: 'topBar',
title: 'Meniu',
items:[
{
text: 'Furnizori',
iconCls: 'x-fa fa-qrcode',
menu: 'APP.view.main.menus.menuFurn'
}
]
});
我的APP.view.main.topBar如下所示:
Ext.define('APP.view.main.Main', {
extend: 'Ext.container.Container',
xtype: 'app-main',
id: 'root',
requires: [
'Ext.menu.*'
],
items:[
'APP.view.main.topBar'
]
});
Ext.define('APP.view.main.topBar',{
extend: 'Ext.container.Container',
docked: 'top',
xtype: 'toolbar',
id: 'topBar',
title: 'Meniu',
items:[
{
text: 'Furnizori',
iconCls: 'x-fa fa-qrcode',
menu: 'APP.view.main.menus.menuFurn'
}
]
});
问题是我得到了以下错误:
Invalid config, must be a valid config object
我试图将工具栏包含在main类的项中。main类中的项必须是正确的对象。见下文:
Ext.define('APP.view.main.topBar', {
extend: 'Ext.container.Container',
docked: 'top',
xtype: 'myAppTopBar',
id: 'topBar',
title: 'Meniu',
items: [{
text: 'Furnizori',
iconCls: 'x-fa fa-qrcode',
menu: 'APP.view.main.menus.menuFurn'
}
]
});
Ext.define('APP.view.main.Main', {
extend: 'Ext.container.Container',
xtype: 'app-main',
id: 'root',
requires: [
'Ext.menu.*'
],
items: [{
xtype: 'myAppTopBar'
}]
});