ext tabpanel autoload的问题
下面的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++;
})
});