在extjs中将项添加到tabPanel的tabBar中
Add item to tabBar of a tabPanel in extjs
我有一个静态选项卡面板,我无法修改它。它没有任何选项卡配置。但我想用它的一个子面板向它的tabBar添加一些项目(在tabPanel右侧添加一些按钮)。我该怎么做?我使用的是extjs 4.2。
我的标签栏:
tabBar: {
items: [{
xtype: 'tbfill'
},
{
itemId : 'completeButton',
iconCls : 'icon-complete',
xtype: 'button',
text: 'complete'
}, {
itemId : 'diagramButton',
iconCls : 'icon-diagram',
xtype: 'button',
text: 'diagram'
}]
}
将项目添加到选项卡栏的代码:
//childPanel is a direct child of rootTabPanel
//button is a button that should be added to rootTabPanel tabBar
addButton2Toolbar : function(childPanel,button){
var rootTabPanel = childPanel.up('tabpanel');
// add button to tabBar of rootTabPanel ?????
}
我已经向tabBar添加了一个fieldcontainer项,并将tabBars项移动到fieldcontainers项。
tabBar: {
items: [{
xtype: 'tbfill'
}, {
xtype : 'fieldcontainer',
itemId : 'toolBar',
layout : 'hbox',
items : [ {
itemId : 'completeButton',
iconCls : 'icon-complete',
xtype: 'button',
text: 'complete'
}, {
itemId : 'diagramButton',
iconCls : 'icon-diagram',
xtype: 'button',
text: 'diagram'
}]
}]
}
将项目添加到选项卡栏的代码:
//childPanel is a direct child of rootTabPanel
//button is a button that should be added to rootTabPanel tabBar
addButton2Toolbar : function(childPanel,button){
var rootTabPanel = childPanel.up('tabpanel');
var toolBar = rootTabPanel.down('fieldcontainer#tabBar');
toolBar.add(button);
}
相关文章:
- PhoneGap/Cordova TabBar插件和所选页面
- ExtJS 4 DataView inside TabPanel
- Using ASP TabPanel Onclick
- 尝试在TabPanel中选择选项卡时出现UmbrellaException
- 在extjs中将项添加到tabPanel的tabBar中
- TabPanel焦点问题
- React Native Tabbar iOS绑定问题[期望一个组件类,得到object object]
- Bootstrap CheckBox Into TabPanel Tab does 't勾选/取消勾选
- 向Ext.TabPanel添加不可选择的文本选项卡
- 得到我的tabpanel组件,但不能使用添加添加一个选项卡
- 通过TabPanel在Parent中传递子值
- TabPanel中元素的对齐
- 关于tabpanel的歧义tabPosition:left
- 通过焦点切换在TabPanel中添加和删除选项卡
- tabPanel的内容没有显示
- TabPanel内部的嵌套列表
- 如何在TabPanel中不使用选项卡而获得items对象
- onClientLoad CSJS中的当前TabPanel ID
- setActiveItem上的TabPanel卡正在消失
- Ext JS tabpanel不适合窗口大小