ext tabpanel autoload的问题

sling2007 2010-02-24 02:06:10
下面的tab中把testX.htm加载过来

那么在各个testX.htm中的是否可以定义重名的全局变量,或者声明一样的函数呢?

我试了一下,如果这样的话,后打开的页面的全局变量会覆盖先打开的页面的变量

而后打开的页面的函数会覆盖先打开的页面的函数


那么我怎么能阻止这种覆盖呢?

Ext.onReady(function(){
Ext.QuickTips.init();

var tabsDemo=new Ext.TabPanel({
renderTo:'hello',
activeTab:0,
width:500,
height:500,
enableTabScroll:true,
items:[]
});

var index=0;
Ext.get("AddNewTab").on("click",function(){
tabsDemo.add({
title:"newtab"+index,
id:"newtab"+index,
//html:"new tab"+index,
autoLoad:{url:"test"+index+".htm",scripts:true},
closable:true
});
tabsDemo.setActiveTab("newtab"+index);
index++;
})
});
...全文
191 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
sling2007 2010-02-26
  • 打赏
  • 举报
回复
up .
sling2007 2010-02-26
  • 打赏
  • 举报
回复
???????????????????.
sling2007 2010-02-25
  • 打赏
  • 举报
回复
我再顶............
YaoZhengWu 2010-02-24
  • 打赏
  • 举报
回复
j解决不了…

87,910

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧