【发布时间】:2016-05-24 17:46:22
【问题描述】:
我正在尝试设计一种类似于image 中所示的布局。我尝试了以下代码
Ext.application({
name : 'Fiddle',
launch : function() {
Ext.create('Ext.panel.Panel', {
xtype: 'panel',
renderTo: Ext.getBody(),
defaults: {
// applied to each contained panel
bodyStyle: 'padding:20px'
},
items: [{
// This is the component A in layout image
xtype: 'textfield',
fieldLabel: 'Text-1'
},{
// This is the component B in layout image
xtype: 'textfield',
fieldLabel: 'Text-2'
},{
// This is the component C in layout image
xtype: 'textareafield',
fieldLabel: 'TextArea-1',
colspan: 2
}],
layout: {
type: 'table',
columns: 2,
align:'stretch'
},
});
}
});
但我无法让 colspan 为 textarea 字段工作。上述代码的输出类似于this。
谁能帮我完成这个工作?
PS:我尝试通过创建容器 - Hbox 布局组合来模拟表格布局。那个有效。但我仍然需要让这个工作正常。
【问题讨论】:
-
您是否尝试过以百分比形式使用
width(宽度:'100%'),因为我认为这里的问题是 textarea 的 colspan 为 2,但它的宽度没有适合父母,
标签: extjs tablelayout