PDA

View Full Version : Button next to Form Fields



sachindhake
17 Sep 2010, 2:03 AM
I want to place the buttons exactly next to form fields. I tried using column layout, but that doesn't work and breaks the existing form layout. Is it possible ?

Please see the attachment.

Thanks in advance

troseberry
18 Sep 2010, 9:38 AM
try using the 'hbox' layout instead. Really simple example.



Ext.onReady(function() {
var a = new Ext.Panel({
renderTo: Ext.getBody(),
width: 200,
frame: true,
layout: 'hbox',
defaults: { margins: '0 5 0 0'},
items:[{
xtype: 'textfield'
},{
xtype:'button',
text: 'Button'
}]
});
});

StuartAshworth
19 Sep 2010, 1:50 AM
Try using the CompositeField.

tjstuart
19 Sep 2010, 5:47 PM
Why not just use TriggerField?

troseberry
19 Sep 2010, 5:51 PM
I agree with Stoot98 the CompositeField is a easier solution than my previous suggestion.

StuartAshworth
20 Sep 2010, 12:59 AM
Actually, use a TriggerField as tjstuart suggests, it will be a lot tidier! Sorry for the conflicting answers!