PDA

View Full Version : Numberfield, combobox layout breaks



Richardh Rotterdam
12 Jun 2012, 1:37 AM
Hi I'm having trouble getting the layout to work right for the numberfield and combobox.

I'm adding a numberfield dynamicly to a FieldContainer and this sometimes causes the up and down buttons to render below the text field.
Example


Ext.define('My.form.field.DateConstraint', {
extend: 'Ext.form.FieldContainer',
constructor: function() {
this.callParent(arguments);
this._addNumberField();
},
_addNumberField: function() {
var numberfield = Ext.create('Ext.form.Number', {


});
this.add(numberfield);
}
});


Anyone out there that might have an idea why the gui up and down are rendered below the text field instead of after? Or perhaps some pointers how to get that behind it after render? I removed all the CSS so I can rule that one out.

scottmartin
21 Jul 2012, 12:59 PM
See if this will give you the result you are looking for:



Ext.define('My.form.field.DateConstraint', {
extend: 'Ext.form.FieldContainer',
alias: 'widget.myfieldcontainer',

initComponent: function (config) {
var me = this;

Ext.applyIf(me, {
items: [
{ xtype: 'numberfield' },
{ xtype: 'textfield' }
]
});

me.callParent(arguments);
}
});

Ext.create('My.form.field.DateConstraint', {
renderTo: Ext.getBody()
});


Regards,
Scott.