所以我有以下场景 在我的主视图中,我有一个像这样的容器:
Ext.define('APP.view.main.Main', {
extend: 'Ext.container.Container',
xtype: 'app-main',
id: 'root',
requires: [
'Ext.menu.*'
],
items:[
'APP.view.main.topBar'
]
});
我的 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
我正在尝试将工具栏包含在主项目中
最佳答案
主类中的项目必须是一个适当的对象。见下文:
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'
}]
});
关于javascript - ExtJs 工具栏配置对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50509004/