PDA

View Full Version : [CLOSED] [2.1] From panel field's width incorrect behaviour



Leonid_Veriga
Sep 04, 2012, 10:53 AM
Hello.

Please, review code sample below. It is looks like Width property sets width for field with label, not for field itself. For example, we set Width = 200 for combobox, which has LabelWidth = 95, LabelPad = 5, then width of the combobox would be (200 - 95 - 5) = 100. It seems for me like a bug.

Is it a bug? Or this works as designed?


<ext:FormPanel runat="server">
<FieldDefaults>
<CustomConfig>
<ext:ConfigItem Name="LabelWidth" Value="120" Mode="Raw" />
</CustomConfig>
</FieldDefaults>
<Items>
<ext:ComboBox runat="server" Width="100" FieldLabel="Combo without container" />
<ext:FieldContainer runat="server" FieldLabel="Combo in container">
<Items>
<ext:ComboBox ID="ComboBox1" runat="server" Width="100" />
</Items>
</ext:FieldContainer>
</Items>
</ext:FormPanel>


Best regards.

Vladimir
Sep 04, 2012, 11:24 AM
No, it is designed behaviour. Field is not input element only, it is label, note, error messages, indicator and triggers

Daniil
Sep 04, 2012, 11:29 AM
Hi,

Here is the Docs article about Width.
http://docs.sencha.com/ext-js/4-1/#!/api/Ext.AbstractComponent-cfg-width


The width of this component in pixels.

A FieldLabel is a part of the ComboBox component. So, the width of FieldLabel is a part of ComboBox Width.

You can specify a width for an <input> part of the field setting the ComboBox InputWidth property.

Please note this property was added just a few days ago.
http://forums.ext.net/showthread.php?18696&p=89482&viewfull=1#post89482

If it is absent in your dlls, please update from SVN or set it via CustomConfig.

Leonid_Veriga
Sep 04, 2012, 1:25 PM
Thank you for clarification.