我有把小提琴:
https://fiddle.sencha.com/#fiddle/4gr
TBar按钮在所有选项卡中都是可见的,因为它是选项卡面板的tbar。
我想你们都同意"TBar按钮“,只要它在当前的位置上,应该只对活动选项卡产生影响,对吗?
那么,我如何才能让tbar显示在标签上方,用户可以直观地猜出tbar对所有选项卡都有影响?
发布于 2014-03-26 06:05:08
与使用tbar不同,您可以使用tools选项为整个选项卡面板配置一个按钮。
var panel = Ext.create("Ext.tab.Panel", {
layout: 'fit',
width: 500,
height: 500,
autoRender: true,
tools: [{
xtype: 'button',
text: 'TBar Button'
}],
items: [{
xtype: 'panel',
title: 'A'
}, {
xtype: 'panel',
title: 'B'
}]
});发布于 2017-03-24 19:10:45
通过使用dockedItems可以订购weight
var panel = Ext.create("Ext.tab.Panel", {
layout: 'fit',
width: 500,
height: 500,
autoRender: true,
dockedItems: [
{
xtype: 'toolbar',
items: [{
xtype: 'button',
text: 'TBar Button'
}],
weight: -2
}
],
items: [{
xtype: 'panel',
title: 'A'
}, {
xtype: 'panel',
title: 'B'
}]
});https://stackoverflow.com/questions/22643451
复制相似问题