我的技术贴的首发地址:http://atian25.javaeye.com/

天猪部落阁 - (ExtJS && AS3 && Java)

专注于ExtJS && AS3 && Java

常用链接

统计

FLASH

WORK

友情链接

最新评论

[原创]EXTJS双击TabPanel标签关闭该页

 1 var tabs = new Ext.TabPanel({  
 2     renderTo: 'tabs1',  
 3     width:450,  
 4     activeTab: 0,  
 5     frame:true,  
 6     defaults:{autoHeight: true},  
 7     items:[  
 8         {contentEl:'script', title: 'Short Text'},  
 9         {contentEl:'markup', title: 'Long Text'}  
10     ],  
11     initEvents : function(){  
12             Ext.TabPanel.superclass.initEvents.call(this);  
13             this.on('add', this.onAdd, this, {target: this});  
14             this.on('remove', this.onRemove, this, {target: this});  
15             this.mon(this.strip, 'mousedown', this.onStripMouseDown, this);  
16             this.mon(this.strip, 'contextmenu', this.onStripContextMenu, this);  
17             if(this.enableTabScroll){  
18                 this.mon(this.strip, 'mousewheel', this.onWheel, this);  
19             }  
20             //ADD:monitor title dbclick  
21             this.mon(this.strip,'dblclick',this.onTitleDbClick,this);  
22         },  
23                  //ADD: handler  
24         onTitleDbClick:function(e,target,o){  
25             var t = this.findTargets(e);  
26             if (t.item.fireEvent('beforeclose', t.item) !== false) {  
27                         t.item.fireEvent('close', t.item);  
28                         this.remove(t.item);                  
29                    }  
30         }  
31 });

posted on 2009-07-01 10:23 天猪 阅读(2989) 评论(0)  编辑  收藏 所属分类: JavascriptExtJS


只有注册用户登录后才能发表评论。


网站导航: