Results 1 to 2 of 2

Thread: Numberfield, combobox layout breaks

  1. #1
    Sencha User
    Join Date
    Nov 2011
    Location
    Rotterdam, Netherlands
    Posts
    6
    Vote Rating
    0
      0  

    Default 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,388
    Answers
    716
    Vote Rating
    499
      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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •