JeffWithG
6 Sep 2011, 9:15 PM
I'm trying to add multiple form fields on the same line using hbox layout, but the styling is not what I expect. What is happening is the items in the hbox are getting the 'first-child' class added, so the items have the rounded corners, etc.
Can anyone point me in the right direction? What is the best way to layout multiple fields on one horizontal line?
Thank you!!
here is the form:
views.MedDetail = Ext.extend(Ext.form.FormPanel, { id: 'MedDetail',
fullscreen: true,
items: [{
xtype: 'fieldset',
title: 'Add Medication',
items: [{
xtype: 'textfield',
name: 'name',
label: 'Name'
},{
xtype: 'panel',
layout: {
type: 'hbox',
align: 'stretch'
},
items: [{
xtype: 'textfield',
name: 'dosage',
flex: 1,
label: 'Dosage'
},{
xtype: 'selectfield',
name: 'measure',
options: [{
text: 'Tablespoon',
value: 'tbs'
},{
text: 'Teaspoon',
value: 'tsp'
}]
}]
}]
}],
listeners: {
'beforeactivate': function () {
medtreker.views.titlebar.down('#saveMed').show();
}
}
});
Can anyone point me in the right direction? What is the best way to layout multiple fields on one horizontal line?
Thank you!!
here is the form:
views.MedDetail = Ext.extend(Ext.form.FormPanel, { id: 'MedDetail',
fullscreen: true,
items: [{
xtype: 'fieldset',
title: 'Add Medication',
items: [{
xtype: 'textfield',
name: 'name',
label: 'Name'
},{
xtype: 'panel',
layout: {
type: 'hbox',
align: 'stretch'
},
items: [{
xtype: 'textfield',
name: 'dosage',
flex: 1,
label: 'Dosage'
},{
xtype: 'selectfield',
name: 'measure',
options: [{
text: 'Tablespoon',
value: 'tbs'
},{
text: 'Teaspoon',
value: 'tsp'
}]
}]
}]
}],
listeners: {
'beforeactivate': function () {
medtreker.views.titlebar.down('#saveMed').show();
}
}
});