extjs tabpanel 刷新,双击TabPanel标签关闭该页

//左则菜单点击事件,重新刷新页面
Java代码
    tree.on('click', function(node, e){  
        if(node.isLeaf()){  
            e.stopEvent();  
            //var autoLoad = {url:node.attributes.href};  
            tabPanel.add({  
             title:node.attributes.text,  
             id: node.id,  
             closable:true,  
             minHeight:500,     
                autoScroll:false,     
                frame:true,     
                html:'<iframe id="iframe'+node.id+'" name="iframe'+node.id+'" src="'+node.attributes.href+'" width="100%" height="100%" frameborder="0" scrolling="auto"></iframe>'  
            });  
            tabPanel.setActiveTab(node.id);  
//点击左则菜单重新刷新页面  
window.frames["iframe"+node.id].location.reload();    
        }  
    });  

//Tabpanel上点击标签重新刷新页面
Java代码
    tree.on('click', function(node, e){  
    if(node.isLeaf()){  
        e.stopEvent();  
        //var autoLoad = {url:node.attributes.href};  
        tabPanel.add({  
            title:node.attributes.text,  
            id: node.id,  
            closable:true,  
            minHeight:500,     
                autoScroll:false,     
                frame:true,     
                html:'<iframe id="iframe'+node.id+'" name="iframe'+node.id+'" src="'+node.attributes.href+'" width="100%" height="100%" frameborder="0" scrolling="auto"></iframe>' ,  
listeners:{  
    activate:function(tab){  
        window.frames["iframe"+tab.id].location.reload();   
    }  
}  
        });  
        tabPanel.setActiveTab(node.id);  
    }  
   }); 

 

 

 

 

 

双击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  });

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值