UPDATED: May, 17
- resolved rendering issue in IE when the first control is a combo box and it has one or more other controls appended to it
A few of my forms required one or more fields/labels be added to the right of an existing field in a form without having to go through the pain of using columns and them lining up. I also wanted the ability to add small print text below the field like help text. The attached override does just that, it allows you to append other fields within the same column as an existing field:
Code:
var form = new Ext.FormPanel({
id: 'form',
bodyStyle: 'padding: 10px',
border: false,
buttons: [{
text: 'Submit',
scope: this,
handler: function() {
Ext.getCmp('form').getForm().submit({ url: 'noscript.php' });
}
}],
items: [{
xtype: 'textfield',
name: 'text',
fieldLabel: 'TextField',
helpText: 'This is the help info for this group of widgets',
append: [{
xtype: 'datefield',
name: 'date'
}, {
xtype: 'button',
text: '...',
handler: function() {
alert('do something here');
}
}]
}, {
xtype: 'numberfield',
name: 'number',
fieldLabel: 'NumberField',
helpText: 'Only enter numbers'
}]
});
The code above will create the items illustrated in the attached image.
The coding may not be 100% and if you have alternate ways of doing things, I'm all ears.