rt
我想双击关闭tab页面,但是没有对应的事件
有人有好办法么
[b]问题补充:[/b]
to yourgame
这位仁兄,tabpanel根本没有dbclick这个事件
[b]问题补充:[/b]
我指的是,双击tab的title,就可以关闭当前的tab页面,类似于maxthon等,而不必去点击title上那个小叉叉。
但是tabpanel根本没有双击事件的
[b]问题补充:[/b]
to yourgame
是的,我就是那个意思。因为现行的所有网站以及maxthon、tt等,打开的tab标签页面,都是可以通过双击tab标签的title执行关闭的,非要点击那个小叉叉,感觉不是很快捷
[code="javascript"]
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);
}
//monitor title dbclick
this.mon(this.strip,'dblclick',this.onTitleDbClick,this);
},
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);
}
}
});
[/code]
on('dbclick',function(){this.close()})
el.on('dbclick', this.dbClick, this, {
single: true,
delay: 100,
forumId: 4
});
你的意思是双击tab页就关闭,和腾讯TT一样?
到源代码里面看看。我现在不方便帮你查