论坛首页 入门技术论坛

ext做多个标签

浏览 1469 次
该帖已经被评为新手帖
作者 正文
   发表时间:2008-07-14  
<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>

 

论坛首页 入门技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics