ExtJS TabPanel 탭을 두 번 클릭하여 페이지 닫기

1626 단어 ext
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 이벤트를 추가하기 위해 더 수정할 수 있습니다.

좋은 웹페이지 즐겨찾기