1. #1
    Ext User Perfect Lion's Avatar
    Join Date
    Aug 2007
    Location
    Brazil
    Posts
    79
    Vote Rating
    0
    Perfect Lion is on a distinguished road

      0  

    Default [2.2] FormPanel, labelWidth not working

    [2.2] FormPanel, labelWidth not working


    Hi staff,

    I need increase on size the label in my FormPanel, I used the config of FormPanel "labelWidth" more not working =/

    What is bug?

    ex:
    Code:
    var form = new Ext.form.FormPanel({
    	title: 'myForm'
    	, labelWidth: 100 // ex. is not working I tried 10, 20, 50, 100 is nothing =(
    	, items: [
    		{ ... }
    	]
    })

  2. #2
    Sencha - Community Support Team mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236
    Vote Rating
    5
    mystix will become famous soon enough

      0  

    Default


    that's not possible.

    compare your existing code with the code in examples/form/dynamic.js from the official Ext download -- i've just tried that and it works correctly.

  3. #3
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,905
    Vote Rating
    626
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    Agreed, I don't see any issue here:

    Code:
    Ext.onReady(function(){
        var fp = new Ext.form.FormPanel({
            labelWidth: 120,
            renderTo: document.body,
            width: 400,
            height: 400,
            items: [{
                xtype: 'textfield',
                fieldLabel: 'F1'
            },{
                xtype: 'textfield',
                fieldLabel: 'F2'
            }]
        });
    });
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  4. #4
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    91
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    Are you also setting a labelStyle?

    Ext does contain a bug that breaks hideLabels, labelAlign and labelWidth when setting labelStyle.

  5. #5
    Ext User Perfect Lion's Avatar
    Join Date
    Aug 2007
    Location
    Brazil
    Posts
    79
    Vote Rating
    0
    Perfect Lion is on a distinguished road

      0  

    Default


    I tried large 100 is work more less tha 100 not working this is normal??

  6. #6
    Sencha - Community Support Team mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236
    Vote Rating
    5
    mystix will become famous soon enough

      0  

    Default


    not it's not. post a full test case, and/or take note of @condor's question in post #4.

  7. #7
    Sencha User
    Join Date
    Jun 2012
    Posts
    2
    Vote Rating
    0
    grephin is on a distinguished road

      0  

    Default I got the same problem too

    I got the same problem too



    I got the same problem with you and even the width, height, labelAlign are not working too..

    I used the form panel in the pop up whenever a button was clicked..

    here's my code, do you already have the solution for this problem?

    erorextjs.txt

  8. #8
    Sencha User
    Join Date
    Dec 2012
    Posts
    1
    Vote Rating
    0
    smlgroot is on a distinguished road

      0  

    Default


    Hi, I solved the problem using Ext.form.Labelable configuration as is described here http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.form.Labelable

    Example:


    newExt.form.Panel({ fieldDefaults:{ labelAlign:'left', labelWidth:100}, items:[{ xtype:'fieldset', defaults:{ labelAlign:'top'}, items:[{ name:'field1'},{ name:'field2'}]},{ xtype:'fieldset', items:[{ name:'field3', labelWidth:150},{ name:'field4'}]}]});Regards.