var tabs = new Ext.TabPanel({ renderTo: 'tabs1', width:450, activeTab: 0, frame:true, defaults:{autoHeight: true}, items:[ {contentEl:'script', title: 'Short Text'}, {contentEl:'markup', title: 'Long Text'} ], initEvents : function(){ Ext.TabPanel.superclass.initEvents.call(this); this.on('add', this.onAdd, this, {target: this}); this.on('remove', this.onRemove, this, {target: this}); this.mon(this.strip, 'mousedown', this.onStripMouseDown, this); this.mon(this.strip, 'contextmenu', this.onStripContextMenu, this); if(this.enableTabScroll){ this.mon(this.strip, 'mousewheel', this.onWheel, this); } //ADD:monitor title dbclick this.mon(this.strip,'dblclick',this.onTitleDbClick,this); }, //ADD: handler onTitleDbClick:function(e,target,o){ var t = this.findTargets(e); if (t.item.fireEvent('beforeclose', t.item) !== false) { t.item.fireEvent('close', t.item); this.remove(t.item); } } });
回答问题: http://www.iteye.com/problems/19385
可以进一步修改为添加一个titiledbclick event.