EXT TAB 标签页 关闭其它选项卡
Ext.getCmp("tabpanel").on("contextmenu",
function(tabPanelObj, tab, e) {
var contextMenu = new Ext.menu.Menu([ {
id : tab.id + "-close",
text : "关闭当前选项卡",
handler : function() {
tabPanelObj.remove(tab);
}
}, {
id : tab.id + "-close-others",
text : "关闭其它选项卡",
handler : function() {
tabPanelObj.items.each(function(item) {
if (item.closable && item != tab) {
tabPanelObj.remove(item)
}
}
);
}
} ]);
//显示Menu
contextMenu.showAt(e.getPoint());
});