PDA

View Full Version : Field in FieldContainer cannot align well with normal Field



disller
13 Sep 2012, 5:55 PM
Hi there,
(Ext 4.1.0)
Why the component in FieldContainer cannot align well with others, which is a little shorter than normal fields in Form, I have tried some configurations of FieldContainer but cannot make them same length.

Anyone can provide some hints, thanks



var panel = Ext.create('Ext.form.Panel', {
layout : 'fit',
renderTo : Ext.getBody(),
bodyPadding: 10,
floating : true,
items : [ {
xtype : 'fieldset',
layout : {
type : 'vbox',
align : 'stretch'
},
title : 'test',
items : [ {
xtype : 'textfield',
fieldLabel : 'text'
}, {
xtype : 'fieldcontainer',
layout : {
type : 'hbox',
align : 'stretch'
},
fieldLabel : 'field',
items : [
{xtype:'numberfield',flex:1}
]
},{
xtype : 'fieldcontainer',
layout : {
type : 'hbox',
align : 'stretch'
},
fieldLabel : 'field2',
items : [
{xtype:'numberfield',flex:1},
{xtype:'displayfield',value:'to'},
{xtype:'numberfield',flex:1}
]
} ]
} ]
})

panel.show();

scottmartin
13 Sep 2012, 6:37 PM
Can you send a screen of what you see and where the problem is?
Have you tried 4.1.1, as the screen does display differently with your code.

Scott.

disller
13 Sep 2012, 7:20 PM
I tried to upload screen, but always got Error #2038.

Ext 4.1.0 (https://www.dropbox.com/s/fc82qs65fk5phnx/1.png)
Ext 4.1.1 (https://www.dropbox.com/s/9a40n66dkhpxeme/2.png)

disller
13 Sep 2012, 7:27 PM
Thanks for response,

I tried many times to upload pic from my ubuntu, but it always got an IO Error #2038.
Finally, I made it from my windows VM.

use 4.1.0
38688

use 4.1.1
38689

scottmartin
13 Sep 2012, 7:50 PM
I do not see this alignment issue in either version.

To make sure .. do you have your code wrapped in:



Ext.onReady(function(){
// your code
});


To make sure the DOM is ready.

If this does not help, please provide more details. OS, Browser, etc.

Scott