View Full Version : [CLOSED] Layout bug in CompositeField

5 Jul 2010, 11:37 PM
Hi all! This is my first bug report so I am sorry if I did something wrong...

I stumbled upon the following issue when using a CompositeField. I've got a DisplayField and two Buttons on it. And if the DisplayField has no value, the last button overlaps the first. However if the display field has some value, the buttons are layed out correctly. Here is the code and the illustration. I am not sure whether this is an HBoxLayout bug or something specific to CompositeField...

Ext Version: 3.2.1

new Ext.form.CompositeField({
fieldLabel: 'Label',
items: [
new Ext.form.DisplayField({
//value: 'some value' // uncomment this to make buttons layed out properly
new Ext.Button({
text: 'Button1',
handler: function(b, e) {
new Ext.Button({
text: 'Button2',
handler: function(b, e) {

It's not critical and maybe it's not even a bug but still wanted to share this...

P.S. This behaviour seems to be in all browsers, tested in FF 3.6, Chrome, Opera 10.60

P.P.S. The issue also goes away if I specify a width property for the display field but I want it to be dynamic in my case.

5 Jul 2010, 11:58 PM
This is probably more a problem of DisplayField than CompositeField (DisplayField should render a   instead of nothing for an empty value).

6 Jul 2010, 12:46 AM
Yeah, looks like it. But would it be universally appropriate if a DisplayField with empty value be rendered to a nbsp?

6 Jul 2010, 3:38 AM
I would associate this issue with the need of calling CompositeField.doLayout() method after it's content has changed dynamically.
There have already been bugfixes on CompositeField behaviour in recent ExtJS releases but it still seems to need some work.

Jamie Avins
7 Jul 2010, 9:45 AM
Until CompositeField becomes a true container (Ext 4.x) using CompositeField in the manner isn't supported.