extjs tablepanel 高度自适应有关问题

时间:2023-09-16 17:14:02

extjs tablepanel 高度自适应问题

项目中为了给客户好点的功能切换体验,想到了用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
}
]
});
});