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'
]
});
我的 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'
}]
});
推荐阅读
- reactjs - React 中的图像修改
- arrays - 将字符串转换为数组
- java - 数据未保存在 Firebase 实时数据库中
- webpack - 如何编译代码以使 JSON 与 webpack 的 main.js 分开?
- string - 如何将两个字符串传递给 PowerShell 函数?
- c# - c#HttpClient参数化查询
- c# - 将 SQL 表中的数据绑定到使用 C# 中的用户控件创建的自定义列表
- python - Python / Kivy:如何更改列表创建的方向
- javascript - NgRx createReducer() 和 on() 给出错误
- youtube-api - Youtube API:无法将视频添加到播放列表