我有一个像这样的extjs窗口对象:
win = new Ext.Window({
layout:'fit',
title: '<spring:message code="title.alertDetails" />',
autoDestroy: true,
autoScroll: true,
width:600,
height:400,
closable:false,
plain: true,
items: [detailGrid,msgDetailsPanel],
buttons: [{
text: '<spring:message code="label.button.close" />',
handler: function(){
win.hide(this);
}
}]
});
有两项:detailGrid(GridPanel)和msgDetailsPanel(Ext.ux.ManagedIFrame.Panel)。
现在当窗口渲染时,即使网格只有1个项目,detailGrid也会占用大量的垂直空间,我需要向下滚动才能看到msgDetailsPanel。如何根据内容自动调整这两个项目?
答案 0 :(得分:1)
我认为最好的方法是:
layout
获胜;网格的center
区域和面板的south
。height = win.height - grid.getStore().getCount() * 25 - 30;
split = true
答案 1 :(得分:1)
只需为autoHeight : true
和grid
设置ManagerIFramePanel
,然后删除这两者的height
属性。然后,grid
和panel
只会占用child items
或grid rows
所需的空间。
答案 2 :(得分:0)
原因实际上是因为你有布局:'fit'设置在窗口本身,它应该只支持跨越面板整个高度和宽度的单个项目。使用布局:'auto',或者'vbox'/'hbox'。