欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

ext做多个标签

程序员文章站 2022-03-07 23:19:01
...
<div id="jtabs"></div>

 先在页面写一个DIV,定义他的ID,然后写JS代码如下

<script type="text/javascript">
			
			var work = {					   
				    init : function(){	
						var jtabs = new Ext.TabPanel('jtabs');
						var scalarTabIframe = Ext.DomHelper.append(document.body, {tag: 'iframe',scrolling:'no',width:'999',height:'410',id:'scalarTab', frameBorder: 0});
						var scalarTab = jtabs.addTab(scalarTabIframe.id, "日常");
						scalarTab.on('activate',function(){
							scalarTabIframe.src = "/abc.do?orgDataNodeRole=0&_="+(new Date()).getTime();
						});
						
						var rationTabIframe = Ext.DomHelper.append(document.body, {tag: 'iframe',scrolling:'no',width:'999',height:'410',id:'rationTab', frameBorder: 0});
						var rationTab = jtabs.addTab(rationTabIframe.id, "定量");
						rationTab.on('activate',function(){
							rationTabIframe.src = "/cab.do?orgDataNodeRole=0&_="+(new Date()).getTime();
						});
						
						var activityTabIframe = Ext.DomHelper.append(document.body, {tag: 'iframe',scrolling:'no',width:'999',height:'410',id:'activityTab', frameBorder: 0});
						var activityTab = jtabs.addTab(activityTabIframe.id, "定时");
						activityTab.on('activate',function(){
							activityTabIframe.src = "/dca.do?method=load&_="+(new Date()).getTime();
						});
						jtabs.activate(0);
					}
				}
			Ext.onReady(work.init, work, true);
		</script>

 

相关标签: EXT JavaScript