extjs - 如何在 ExtJs 的标签栏中动态添加 tbar
问题描述
我需要在 tabpanel 的第二个选项卡中动态添加 tbar(不想在 tbar 中动态添加项目,但需要根据某些条件添加 tbar,否则应该添加 bot),下面是我的代码:
var wind = Ext.create("Ext.Window", {
modal: true,
scrollable: true,
items: [
{
margin: '0 0 0 10',
xtype: 'tabpanel',
reference: "MainTab",
plain: true,
resizeTabs: true,
flex: 1,
border: 3,
items: [
{
title: "Messages",
rootTab: true,
items: [{
// item
}] }, {
title: "Alarms",
items: [{
//item,
}],
tbar: // need to add this tbar dynamically
}]
我已经尝试使用 dockedItems 使用 initComponent 但对我不起作用。
解决方案
推荐阅读
- python - 使用 openpyxl 创建两个 y 轴图表
- swift - 快速操场上的斐波那契
- php - 如何使用 AJAX 发布请求更改 HTML DOC 的背景颜色:
- opengl - 简单来说,textureGrad() 是什么?
- android - 满足条件时使肯定按钮无效
- python - 创建一个多元偏斜正态分布python
- redis - DigitalOcean pod 具有未绑定的即时 PersistentVolumeClaims
- wpf - 如何防止将我的应用程序的第一个菜单项集中在启动时?
- google-cloud-platform - 谷歌云平台:cloudshell - 有没有办法“保留” gcloud init 配置?
- r - lapply 或 sapply 用于 List 中的 data.frames