1. #1
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,616
    Vote Rating
    327
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default Text Field Sizing

    Text Field Sizing


    I'm seeing some sizing issues with text fields and comboboxes.

    Test case:

    Code:
    Ext.onReady(function() {
        Ext.create('Ext.form.field.Text', {
            renderTo: Ext.getBody(),
            listeners: {
                afterrender: function(text) {
                    console.log('afterrender A: ' + text.getWidth());
    
                    Ext.defer(function() {
                        console.log('afterrender B: ' + text.getWidth());
                        text.setWidth(300);
                    }, 1);
                },
                resize: function(text) {
                    console.log('resize: ' + text.getWidth());
                }
            }
        });
    });
    In 4.0.7 the logging from this example gives:

    resize: 150
    afterrender A: 150
    afterrender B: 150
    resize: 300
    With 4.1-pr1 it looks like this:

    afterrender A: 1440
    afterrender B: 150
    The initial size is incorrect (it seems to be making an educated guess based on the size & frame of the surrounding element, which in this case is the document body) and no resize event is being fired, even after an explicit call to setWidth().

  2. #2
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    5,993
    Vote Rating
    212
    slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of

      0  

    Default


    I'm getting text size errors of a sorts, too.
    I've got a form with a formcontainer with textfield / combo / combo / combo.
    Under that is a fieldset containing another formpanel.

    Once the first textfield is blurred it's marked invalid (allowBlank:false) and some of the child elements in the sub-formpanel get pushed around and I get the following error:
    me.lastComponentSize is undefined
    ownerContext.setHeight(me.lastComponentSize.height, false, true);
    ext-all-debug.js (line 38901)

    I could try and boil down some test-code if you like.

    Tested in:
    IE 8
    FF 5
    Last edited by slemmon; 27 Oct 2011 at 7:55 AM. Reason: listed browsers tested in

Thread Participants: 1