乖乖的500K的大家伙,吓死人啊,如果你有20个页面,那你要访问20次,如果你有100个呢,你的机器就会抗不住了,所以,同志们,下载一次才是最佳的方法啊,讲讲怎么实现吧

首先,在tabpanel里面找到这个方法loadClass

小小的修改一下

loadClass:function(href,id,title,icon,member){

var tab=this.getComponent(id);

if(tab){this.setActiveTab(tab);

if(member){tab.scrollToMember(member);}}else{href=href.replace("&", "&");

var autoLoad={url:href,scripts:true,text:'页面正在加载中,请稍候...'};

if(member){autoLoad.callback=function(){Ext.getCmp(id).scrollToMember(member);}} 

var p=this.add(new DocPanel({id:id,title:title,autoLoad: autoLoad,iconCls:icon}));

this.setActiveTab(p);}

global_width=Ext.getCmp('global-body').getActiveTab().getInnerWidth();

global_height=Ext.getCmp('global-body').getActiveTab().getInnerHeight();//这个是当前活动页面的内部高度,以后设置高度的时候额可以直接引用

}});

 

然后再修改api的click方法

api.on('click',function(node,e){if(node.isLeaf()){e.stopEvent();
mainPanel.loadClass(node.attributes.href,node.id,node.text,node.attributes.iconCls);

});

 

其他页面怎么实现

这样实现

<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<div id="ChangePass">
 <center>
  <script>
   Ext.onReady(function(){
   你的方法
  });
  </script>
 </center>
</div>

大家可以先试试看,很简单的

posted on 2009-03-24 18:15  许维光  阅读(1656)  评论(1)    收藏  举报