1. #1
    Sencha User
    Join Date
    Feb 2008
    Posts
    54
    Vote Rating
    0
    rtrocc is on a distinguished road

      0  

    Default Setting a combobox fieldLabel width to include long labels?

    Setting a combobox fieldLabel width to include long labels?


    I want to have a long label stay on the same line rather than breaking off after each word or two. Basically I'm trying to widen the width allowance on the combo box label. Not sure why I can't adjust it like I do with other form field labels ...

  2. #2
    Sencha - Community Support Team jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364
    Vote Rating
    81
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    Embed that combo box in a fieldset and set your custom labelwidth there.

  3. #3
    Sencha User
    Join Date
    Feb 2008
    Posts
    54
    Vote Rating
    0
    rtrocc is on a distinguished road

      0  

    Default


    Sorry about that, I figured out that I have to explicitly set a class on 'x-form-item-label' to a larger width...

  4. #4
    Sencha User
    Join Date
    Feb 2008
    Posts
    54
    Vote Rating
    0
    rtrocc is on a distinguished road

      0  

    Default


    actually... this worked for me:
    Code:
    {
         xtype: 'combo',
         labelStyle: 'width:220px',
         fieldLabel: 'Super Long Label That Cuts Off'
    }

  5. #5
    Ext User
    Join Date
    Mar 2010
    Posts
    1
    Vote Rating
    0
    acogan is on a distinguished road

      0  

    Default fieldlabel fix

    fieldlabel fix


    I was having the same issue and could not figure it out! But after going through forum after forum I realized there is a setLabelStyle.

    so the fix:

    comboBox.setLabelStyle("width:75px"); or whatever width is appropriate for you Label to be in one line
    comboBox.setFieldLabel("Set your label here");

  6. #6
    Sencha User
    Join Date
    Mar 2010
    Posts
    119
    Vote Rating
    0
    spor is on a distinguished road

      0  

    Default


    I tried this
    PHP Code:
     xtype'numberfield',               
                            
    fieldLabelTip'Saksnummer',
                            
    anchor'100%',
                            
    labelStyle'width:30px',
                            
    fieldLabel'Super Long Label That Cuts Off' 
    But got this ScreenHunter_01 Jun. 30 11.03.gif

    This isn't the desired effect. How do I reduce the gap between the fieldlabel and the textfield?

    When I set the width to 5px the gap is still the same.

    When I set the width to 500px I get this:
    ScreenHunter_02 Jun. 30 11.18.gif
    Last edited by spor; 30 Jun 2010 at 1:22 AM. Reason: more pics and info

  7. #7
    Sencha User
    Join Date
    Sep 2010
    Posts
    5
    Vote Rating
    1
    jefftrull is on a distinguished road

      0  

    Default


    I also find that setting the "width" style causes a gap of a compensating size to open up between the label and the field. I have a small label, and would like to reclaim that empty space for the field. Help!

  8. #8
    Sencha User
    Join Date
    Mar 2010
    Location
    Huntsville, AL
    Posts
    21
    Vote Rating
    0
    scottlusk.cis is on a distinguished road

      0  

    Default Empty space between fieldLabel and Combo

    Empty space between fieldLabel and Combo


    Quote Originally Posted by jefftrull View Post
    I also find that setting the "width" style causes a gap of a compensating size to open up between the label and the field. I have a small label, and would like to reclaim that empty space for the field. Help!
    I'm having this same problem, were you able to figure it out?