您正在寻找Ext.form.field.FieldContainer
这是最简单的例子:
Ext.create('Ext.form.Panel', {
title: 'FieldContainer Example',
width: 550,
bodyPadding: 10,
items: [{
xtype: 'fieldcontainer',
fieldLabel: 'Last Three Jobs',
labelWidth: 100,
layout: 'hbox',
items: [{
xtype: 'combo',
store: {
fields: ['abbr', 'name'],
data : [
{"abbr":"AL", "name":"Alabama"},
{"abbr":"AK", "name":"Alaska"},
{"abbr":"AZ", "name":"Arizona"}
]
},
queryMode: 'local',
displayField: 'name',
valueField: 'abbr',
flex: 1
}, {
xtype: 'splitter'
}, {
xtype: 'textfield',
flex: 1
}]
}],
renderTo: Ext.getBody()
});
您还可以使 fieldContainer 充当单个字段。快速解释:
- 混入
Ext.form.field.Field
- 将内部字段设置
submitValue
为false