1. #1
    Sencha User
    Join Date
    Nov 2011
    Location
    Rotterdam, Netherlands
    Posts
    6
    Vote Rating
    0
    Richardh Rotterdam is on a distinguished road

      0  

    Default Unanswered: Numberfield, combobox layout breaks

    Unanswered: Numberfield, combobox layout breaks


    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
    Code:
    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.

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,080
    Answers
    674
    Vote Rating
    467
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    See if this will give you the result you are looking for:

    Code:
    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.

Thread Participants: 1

Tags for this Thread