//左则菜单点击事件,重新刷新页面
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 });