PDA

View Full Version : Formpanel with hbox layout --> button is not rendered?



philipp_sidarion
12 May 2010, 2:33 AM
Hi

I have the followind problem: I created a form-panel object with a hbox layout:



var vTestPanel = new Ext.form.FormPanel({
title: 'TestPanel',
id: 'TestPanel',
//tools: tools,
draggable:true,
closeable: false,
bodyStyle:'padding:5px 5px 0',
frame:true,
autoWidth : true,
layout: 'hbox',
width: 700,
height: 116,
padding: 10,
buttonAlign: 'center',
items : [
{
xtype: 'container',
autoEl: 'div',
flex: 7,
layout: 'form',
margins: '0 10 0 0',
items: [
{
xtype: 'textfield',
fieldLabel: 'Label',
anchor: '100%'
}
],
buttons : [{
text: 'Test',
tooltip: 'Testing',
handler: function() {
Ext.MessageBox.alert('Superduper', 'Super.....');
} //end handler
}]
},
{
xtype: 'container',
autoEl: 'div',
flex: 3,
layout: 'form',
items: [
{
xtype: 'textfield',
fieldLabel: 'Label',
anchor: '100%'
}
]
}
],
fbar : {
xtype: 'toolbar',
items: [
{
xtype: 'button',
text: 'MyButton'
}
]
}
});


I want that the button with the text 'Test' is displayed just below the left textfield, in the center of the text field looking like this:

20465

But, only the button defined in the toolbar at the end of the code is drawn, centered below the two text fields... A DOM inspection showed that my first button is also not there as elemen? Does anybody can give me an advice how to place the first button just below and centered the left text field? Thank you very much! Regards
Philipp

Animal
12 May 2010, 2:52 AM
The Container class does not have a "buttons" config.