extjs 布局能嵌套吗?

fanherong 2009-07-14 04:53:17
业务需要,想做一个这样的框架:
先分:北,西,中,南四个区域,然后再将西分为 北,南两个区域。
再将西边区域的layout属性设置为 border时,页面就报错,说不支持该方法。
请指教我的问题出在哪里?或者您有更好的方案?

部分代码如下:

/***北区****/
var northObj={
region: 'north',
html: ' <h1>系统信息 </h1> <h2>logo </h2>',
contentEl: 'div_north',
autoHeight: true,
collapsible: true,
split: true,
border: true,
margins: '0 0 5 0'
}

/***中区****/
var centerObj={
contentEl: 'div_center',
region: 'center',
xtype: 'tabpanel',
items: [{
title: '地图区',
html: 'The first tab\'s content. Others may be added dynamically'
},
{
title: 'Tab2',
html: 'The second tab\'s content. Others may be added dynamically',
tbar:[{xtype:"tbfill"},{pressed:true,text:"save",handler:openWindow}]
}
]
}
/***南区****/
var southObj= {
contentEl: 'div_south',
region: 'south',
xtype: 'tabpanel',
title: '状态区',
collapsible: true,
items:
[ {
title: 'status1',
html: 'status1'
},
{
title: 'status2',
html: 'status2'
}
],
split: true,
height: 100,
minHeight: 100
}

//////////


/***西区****/
var westObj = {
contentEl: 'div_west',
region: 'west',
xtype: 'panel',
title: '状态区',
collapsible: true,
split: true,
width: 200,
layout:'border'//此处出错
}


Ext.onReady(
function(){
var viewport=new Ext.Viewport({
layout: 'border',
defaults: {
activeItem: 1
},
items: [northObj ,centerObj ,southObj ,westObj]
});

}
)
...全文
449 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
syxsyx7 2009-07-20
  • 打赏
  • 举报
回复
border 布局必须有一个默认的center控件
给西区加一个控件 并且region:‘center’应该就可以了
syxsyx7 2009-07-20
  • 打赏
  • 举报
回复
border 布局必须有一个默认的center控件
给西区加一个控件 并且region:‘center’应该就可以了
syxsyx7 2009-07-20
  • 打赏
  • 举报
回复
border 布局必须有一个默认的center控件
给西区加一个控件 并且region:‘center’应该就可以了
gaobaiy 2009-07-19
  • 打赏
  • 举报
回复
oooooooooooooaaa 2009-07-19
  • 打赏
  • 举报
回复
指定layout:'form'试试

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧