如何实现关闭,关闭所有关闭其他标签功能,右键单击标签中的Extjs?
问题描述:
如何实现关闭,关闭所有关闭其他标签功能,右键单击标签中的Extjs?如何实现关闭,关闭所有关闭其他标签功能,右键单击标签中的Extjs?
{
xtype: 'tabpanel',
region: 'center',
reference: 'tabPanelRef',
items: [{
tab-1
},{
tab-2
},{
tab-3
}],
}
答
下面是一个example fiddle使用TabCloseMenu插件。通过将插件包含在您的tabpanel
中,可以通过右键单击选项卡标题来显示close
,close all
和close other
函数。
Ext.define('ExampleTabs', {
extend: 'Ext.tab.Panel',
xtype: 'reorderable-tabs',
requires: [
'Ext.ux.TabCloseMenu',
'Ext.ux.TabReorderer'
],
plugins: [
'tabreorderer',
'tabclosemenu'
],
defaults: {
closable: true
},
items: [{
title: 'Tab 0 - fixed',
html: "Cannot reorder or close this",
reorderable: false,
closable: false
}, {
title: 'Tab 1',
html: 'Tab 1'
}, {
title: 'Tab 2',
html: 'Tab 2'
}, {
title: 'Tab 3',
html: 'Tab 3'
}, {
title: 'Tab 4',
html: 'Tab 4'
}],
});
谢谢工作:) –