PDA

View Full Version : [CLOSED] Label width ignored on NumberField



machinableed
Apr 30, 2012, 2:54 AM
Hi there,

When creating a number field like so:



fields.Add(Html.X().NumberField()
.ID("txtQuotedLeadTime")
.FieldLabel("Quoted Lead Time (weeks)")
.LabelAlign(LabelAlign.Top)
.Cls("form-label")
.Width(75)
.LabelWidth(300)
.Margins("0 0 4 4"));

it seems that the LabelWidth is ignored - instead both label and box wdith are 75. I assume this is a bug unless I'm doing something incorrectly?

Daniil
Apr 30, 2012, 11:50 AM
Hi,

Personally, I would consider it a bug as well. But I'm not sure why it's so.

I've reported to ExtJS. Lets wait what they will answer.
http://www.sencha.com/forum/showthread.php?199887

machinableed
Apr 30, 2012, 12:11 PM
Obviously I can just get around it by setting a css class up for those labels but still it seems that this is incorrect behaviour

Daniil
Apr 30, 2012, 2:40 PM
I agreed.

ExtJS agreed as well, they have opened a bug.
http://www.sencha.com/forum/showthread.php?199887

Daniil
Aug 28, 2012, 5:05 AM
Hi @machinableed,

Sencha added the inputWidht config option.
http://www.sencha.com/forum/showthread.php?199887&p=878154&viewfull=1#post878154

Example

@(Html.X().NumberField()
.FieldLabel("Some looooooong FieldLabel")
.LabelAlign(LabelAlign.Top)
.InputWidth(75)
)

It is available in the 2.1 branch and will be available with the next v2.1 release as well.

Thanks again for the report!