`
ruvuoai
  • 浏览: 94206 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

extjs tablepanel 高度自适应问题

    博客分类:
  • web
阅读更多

项目中为了给客户好点的功能切换体验,想到了用extjs的tabpanel

在页面中用了tabpanel后,高度新打开的tab页的iframe 的高度总是出现无法填满页面的情况

于是被迫给tabpanel指定了高度,为了达到自适应的效果用了

document.body.clientWidth

document.body.clientHeight 

 

代码如下:

 

		Ext.onReady(function() {
			Ext.BLANK_IMAGE_URL = 'script/extjs/resources/images/default/s.gif';
			Ext.QuickTips.init();	
			
			scrollerMenu = new Ext.ux.TabScrollerMenu({
				maxText  : 15,
				pageSize : 5
			});
			
			panel = new Ext.TabPanel({
				applyTo:document.body,
		        enableTabScroll:true,
		        activeTab:0,
		        resizeTabs:true,
		        layoutOnTabChange:true,
		        height:document.body.clientHeight,
		        plugins:['tabclosemenu',scrollerMenu],
		        defaults: {autoScroll:true},
		        items:[{
		            id: 'testPanel',
		            iconCls: 'new-tab',
		            title: '首页',
		            html:'<iframe id="frmmain" name="frmmain" scrolling="auto" frameborder="0" width="100%" height="100%" src="yz/toHandleElectronDocumentList.action"></iframe>',
		            closable:false,
		            autoScroll: true
		        }
		        ]
	    	});
		});
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics