我有麻烦了FormPanel中的煎茶触摸2.布局参见下面的示例应用程序。煎茶触摸2 FormPanel中没有显示正确(布局问题?)
应该有与含有3项“VBOX”布局的面板:一段文字,FormPanel中,和另一块文字。然而,FormPanel似乎获得大小0x0并且根本不显示,所以我只能看到两个文本。
我发现2个东西,拿到表格面板展现出来:
外面板上设置
layout: 'fit'
。但是,然后一切重叠。fit
并非真正为多个项目设计,所以这不是一个解决方案。设置显式
width
和height
在FormPanel上配置。但我希望它自己布局,而不必用像素来指定它。为什么我需要这样做?
我试了一堆其他的随机参数,但我只是在黑暗中拍摄。那么我错过了什么?
Ext.application({
name: 'TestApp',
launch: function() {
return Ext.Viewport.add({
xtype: 'panel',
layout: {
type: 'vbox',
align: 'center'
},
// layout: 'fit' // This shows the form, but overlaps all 3 panel items.
items: [
{ html: 'Fill in the form below' },
{
xtype: 'formpanel',
// width: 300, // These fixed sizes reveal the form, but why?
// height: 300, // These fixed sizes reveal the form, but why?
items: [
{
xtype: 'fieldset',
items: [
{
xtype: 'textfield',
name: 'username',
label: 'Username'
}
]
}
]
},
{ html: 'Fill in the form above' }
]
});
}
});
请参阅下面的@ pfrank的答案,了解其原因。 – dkamins 2013-07-29 19:18:20
在Sencha 2.3上,'scrollable:false'不适用于我。 'scrollable:null'是。 – 2014-04-04 03:34:42
不能使用false。由于这没有记录,所以在将来可以改变,因为使用null – 2014-06-06 08:30:27