日期:2014-05-16  浏览次数:20651 次

EXTJs布局问题,需要手动拉伸布局才行,不能直接按照自定义大小打开?急 - Web 开发 / Ajax
Ext.onReady(function() {
//创建TabPanel
var win;
var container=document.getElementById("container1");
var tabs = new Ext.TabPanel({
region: 'center', //border布局,将页面分成东,南,西,北,中五部分,这里表示TabPanel放在中间
margins: '3 3 3 0',
height:"100%",
activeTab: 0,
defaults: {autoScroll: true},
items: [{title: 'Bogus Tab', html: "第一个Tab的内容." }, {title: 'Another Tab',html: "我是另一个Tab"}, 
{ title: 'Closable Tab', html: "这是一个可以关闭的Tab", closable: true }]
});
//定义一个Panel
var nav = new Ext.Panel({
title: 'Navigation',
region: 'west', //放在西边,即左侧
split: true,
width: "100",
height:"600",
collapsible: false, //允许伸缩
margins: '3 0 3 3',
cmargins: '3 3 3 3'
});
//如果窗口第一次被打开时才创建
win = new Ext.Window({
title: '系统邮件设置',
closable: false,
width: "100%",
height: "800",
border : false,
plain: true,
layout: 'border',
closeAction:'hide',
items: [nav, tabs]//把上面创建的panel和TabPanel放在window中,并采用border方式布局
});
  win.show(container);
 })

------解决方案--------------------
height: "800",
改成
height: 800,
试试。
------解决方案--------------------
height 和 width 请不要写成 height:"100%" 和 width:"100%",这种写法是无效的,不能实现100%的效果。

估计你的问题就出现在这里。

跟楼上,height:"800" 与 height:800 的效果一样,都正确,无异。
------解决方案--------------------
height:"800" 与 height:800 的效果不一样,楼上你可以试试。