EXTJS双击关闭标签代码
1 Ext.override(Ext.TabPanel, {
2 initEvents : function(){
3 Ext.TabPanel.superclass.initEvents.call(this);
4 this.on('add', this.onAdd, this);
5 this.on('remove', this.onRemove, this);
6
7 this.strip.on('mousedown', this.onStripMouseDown, this);
8 this.strip.on('contextmenu', this.onStripContextMenu, this);
9 this.strip.on('dblclick', this.onTitleDbClick, this);
10 if(this.enableTabScroll){
11 this.strip.on('mousewheel', this.onWheel, this);
12 }
13 },
14 onTitleDbClick:function(e,target,o){
15 var t = this.findTargets(e);
16 if (t.item.fireEvent('beforeclose', t.item) !== false && t.item.closable!==false) {
17 t.item.fireEvent('close', t.item);
18 this.remove(t.item);
19 }
20 }
21 });