关于tree与tab的诡异问题

8) 平时看的好多网站没地方存,存浏览器我去了外地没办法看。所以最近在使用ext+gae开发一个网址收藏夹的站点。
这里必须发出站点大家才能看到我的问题,有人觉得广告请见谅:[url]http://www.galo.tk[/url],问题在于比如光荣墙上有一位会员,我双击即可查看他(她)的收藏,即tab增加一个panel,当我关闭这个panel之后,再新开一个panel,或者看已经存在的panel,发现内容居然是已经关掉的他(她)的收藏,只是标题正确,里面的内容完全错位.
点击帮助中心中的菜单,关了再开,再关,多试几次也可以发现问题所在。我很纳闷,特与大家分享!
贴出关键代码:
切换tab的方法如下:

tabAddPanel:function(tabName){
if(!_centerTabP.getItem(tabName))
{
var _centerP = Ext.getCmp(tabName);
_centerTabP.add(_centerP).show();
}
_centerTabP.setActiveTab(tabName);
_centerTabP.doLayout();
}

树的操作方法:

userHelpTree.on("click",function(node){

var cmd = node.text;
main.extAlert("您点击了【"+cmd+"】");
if(cmd == '修改资料'){

}else if(cmd == '寻找网址'){
main.tabAddPanel("centerP_4");
}else if(cmd == '道具商城'){
main.tabAddPanel("centerP_5");
}else if(cmd == '反馈留言'){
main.tabAddPanel("centerP_6");
}else if(cmd == '本站之最'){
main.tabAddPanel("centerP_7");
}else if(cmd == "开发日记"){
main.tabAddPanel("centerP_8");
}else if(cmd == "帮助中心"){
main.tabAddPanel("centerP_9");
}else{
main.extAlert("杯具,哪里出错了!");
}
});

tab面板的定义:

var centerTabP = new Ext.TabPanel({
id:'centerTabP',
autoDestroy:false,
autoTabs:true,
enableTabScroll:true ,
activeItem:0,
//如果Tab过多会出现滚动条
enableTabScroll:true,
//加载时渲染所有
//deferredRender:false,
closeAction:'hide',
layoutOnTabChange:true
});

tab其中一个定义(大致都差不多):

var centerP_1 = new Ext.Panel({

id:'centerP_1',
title:'光荣墙',
layout:'fit',
contentEl:'centerP_1_div'
});

当点击树时切换不同的面板,大家试试即可发现问题的诡异。 :cry:
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值