无法在extjs中的两个面板之间创建分割区域
我使用了无法在extjs中的两个面板之间创建分割区域,extjs,split,Extjs,Split,我使用了split:true,它一直有效,直到出现以下情况: centerContent = new Ext.Panel ({ layout: 'border', split:true, stateful:true, border:false, items: [ { region:'center', margins:'0 0 0 0', autoScroll
split:true
,它一直有效,直到出现以下情况:
centerContent = new Ext.Panel
({
layout: 'border',
split:true,
stateful:true,
border:false,
items:
[
{
region:'center',
margins:'0 0 0 0',
autoScroll:true,
split: true,
items:
[
{
region: 'north',
height: 250,
minSize: 150,
frame:false,
border:false,
layout:'fit',
items: blah
},
{
title:'Graph',
region:'south',
margins:'0 0 0 0',
collapsible: true,
split:true,
frame:false,
border:false,
height: 500,
minSize: 250,
layout:'fit',
items: anotherBlah
}
]
}
]
});
我试着把split:true放到所有地方,但还是没有结果。为了说明此代码的结果,我附上了一张图片:
north region没有标题,但它呈现给项:blah
。如图所示,南部地区有标题“图”。我希望能够在必要时从北方拆分/拖动南部地区。但“分割工具”不会出现。
你知道我遗漏了什么吗?在同一个容器中不能有边框布局和自动滚动。原因是边框布局将使其子组件适合可用空间,因此它们永远不会溢出 因此,为了实现您想要的,您需要一个具有固定高度的内部容器(使其溢出其父容器),该容器具有
autoScroll
。然后将边框布局应用于该内部容器
示例():
您的“南”面板和“北”面板不是具有边框布局的面板的直接子面板。因此,您知道一种让autoScroll和split一起工作的方法吗。示例代码将不胜感激
Ext.widget('container', {
renderTo: Ext.getBody()
// the 300px container contains a 500px child: it will scroll
,width: 300
,height: 300
,autoScroll: true
,items: [{
xtype: 'container'
,height: 500
// the 500px container has border layout
,layout: 'border'
,items: [{
// you are required to have a center region, so use center and south
title: 'Center'
,region: 'center'
,height: 200
},{
title: 'South'
,region: 'south'
,split: true
,height: 300
}]
}]
});