Hybrid View
-
5 Jun 2008 8:33 AM #1
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 ...

-
5 Jun 2008 8:41 AM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,169
- Vote Rating
- 28
Embed that combo box in a fieldset and set your custom labelwidth there.

Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
5 Jun 2008 8:41 AM #3
Sorry about that, I figured out that I have to explicitly set a class on 'x-form-item-label' to a larger width...
-
5 Jun 2008 8:54 AM #4
actually... this worked for me:
Code:{ xtype: 'combo', labelStyle: 'width:220px', fieldLabel: 'Super Long Label That Cuts Off' }
-
1 Mar 2010 7:27 AM #5
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");
-
30 Jun 2010 1:06 AM #6
I tried this
But got this ScreenHunter_01 Jun. 30 11.03.gifPHP Code:xtype: 'numberfield',
fieldLabelTip: 'Saksnummer',
anchor: '100%',
labelStyle: 'width:30px',
fieldLabel: 'Super Long Label That Cuts Off'
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.gifLast edited by spor; 30 Jun 2010 at 1:22 AM. Reason: more pics and info
-
16 Sep 2010 1:49 PM #7
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!
-
30 Dec 2010 9:36 AM #8


Reply With Quote
