我想用panel做个border布局但是官方例子无法实现能不能帮我看下?
这个为什么无法实现呢?
Ext.onReady(function(){
var border = new Ext.Panel({
title: 'Border Layout',
layout:'border',
items: [{
title: 'South Panel',
region: 'south',
height: 100,
minSize: 75,
maxSize: 250,
margins: '0 5 5 5'
},{
title: 'West Panel',
region:'west',
margins: '5 0 0 5',
cmargins: '5 5 0 5',
width: 200,
minSize: 100,
maxSize: 300
},{
title: 'Main Content',
region:'center',
margins: '5 5 0 0'
}]
});
})
------解决方案--------------------
在new Ext.Panel时再加个renderTo: Ext.getBody()
或者在下面加:border.render(Ext.getBody());
------解决方案--------------------
那也可以啊
你没个高度和宽度啊
Ext.onReady(function(){
var border = new Ext.Panel({
renderTo: Ext.getBody(),
//title: 'Border Layout',
width:1000,
height:300,
layout:'border',
items: [{
title: 'South Panel',
region: 'south',
height: 100,
minSize: 75,
maxSize: 250,
margins: '0 5 5 5'
},{
title: 'West Panel',
region:'west',
margins: '5 0 0 5',
cmargins: '5 5 0 5',
width: 200,
minSize: 100,
maxSize: 300
},{
title: 'Main Content',
region:'center',
margins: '5 5 0 0'
}]
});
});