首先理解viewport是用来指定的布局,与html中的frameSet标签效果相似,Border 布局由类Ext.layout.BorderLayout定义,布局名称为border。该布局把容器分成东南西北中五个区域,
分别由east,south, west,north, center来表示,在往容器中添加子元素的时候,我们只需要指定这些子元素.
源码:
Ext.create('Ext.container.Viewport',{
renderTo:Ext.getBody(),
layout:'border',
items:[
{
title:'面板',
region:"north",
height:200,
html:'<h1>网站后台管理系统</h1>'
},{
title:'content',
region:'center',
html:'<h1>网站后台管理系统</h1>'
},{
title:'左',
region:'west',
width:100
}
]
});
经过指定layout属性指定哪一种类型的布局,然后items来指定布局中的信息。在border布局中,center不可以缺少。在指定items中的对象的时候,resgion用来指定在那一个方位,比如west和center等。