Widths of Form fields

  1. #1

    Widths of Form fields

    Hello,

    Today I upgraded my application to Ext v2 and, unfortunately, I got so many errors that I am about to downgrade to Ext v1.5 :(
    On the other hand, I want to be able to use Ext v2's new features like charting and infinite scrolling.
    Therefore maybe it is a good idea to insist on upgrading.

    Here are one of the issues I couldn't have managed to resolve so far. The samples in the Examples Explorer and CHANGELOG didn't help.
    It'll be really appreciated if anyone can help.

    Form field widths behave strangely. In the following example I expect the widths of txtFirstName and txtAddress be the same. Unfortunately, they are not rendered as such.
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="ExtNet2Test.Default" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!DOCTYPE html>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
        <head runat="server">
            <title></title>
        </head>
        <body>
            <form id="form1" runat="server">
                <div>
                    <ext:ResourceManager ID="ResourceManager1" runat="server">
                    </ext:ResourceManager>
                    <ext:Viewport ID="Viewport1" runat="server" Layout="border">
                        <Items>
                            <ext:Panel ID="Panel1" runat="server" Collapsible="True" Height="200" Region="North" Split="True" Title="North" BodyPadding="5" Width="600">
                                <LayoutConfig>
                                    <ext:VBoxLayoutConfig Align="Left" />
                                </LayoutConfig>
                                <Items>
                                    <ext:FieldContainer ID="FieldContainer1" runat="server" FieldLabel="First/Last Name" AnchorHorizontal="100%" Layout="HBoxLayout" LabelWidth="120">
                                        <Items>
                                            <ext:TextField ID="txtFirstName" runat="server" Width="150" Margins="0 3 0 0"/>
                                            <ext:TextField ID="txtLastName" runat="server" Width="200"/>
                                        </Items>
                                    </ext:FieldContainer>
                                    <ext:TextField ID="txtAddress" runat="server" Width="150" LabelWidth="120" FieldLabel="Address"/>
                                </Items>
                            </ext:Panel>
                            <ext:Panel ID="Panel9" runat="server" Layout="Fit" Region="Center" Title="Center">
                                <Items>
                                </Items>
                            </ext:Panel>
                        </Items>
                    </ext:Viewport>
                </div>
            </form>
        </body>
    </html>

    NOTE: I found the following post. It seems that a new InputWidth property is added in v2.1. But I have v2.0 dlls.

    http://forums.ext.net/showthread.php...rect-behaviour



    Thanks in advance,
    TheDarkLord
    Last edited by thedarklord; Oct 08, 2012 at 1:58 AM.
  2. #2
    Yes, the .InputWidth property has been added in v2.1, although try the following.

    On your txtAddress TextField, add InputWidth="150". The property will not show up in intellisense, but it will render the property value to the client.
    Geoffrey McGill
    Founder
  3. #3
    Thanks Geoffrey.
    I have added the InputWidth property as a custom config.
    Although there are some diffrences with v1.x, it works :)

    You can mark this thread as CLOSED.

    Thanks,

Similar Threads

  1. [CLOSED] Two form fields, one validator
    By jmcantrell in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 14, 2012, 7:57 AM
  2. [CLOSED] Not all form fields are submitted
    By Stefanaccio in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: May 05, 2010, 12:58 PM
  3. [CLOSED] Form does not show the fields
    By flormariafr in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jan 26, 2010, 4:00 PM
  4. [0.8.1] Commit form fields (client)
    By wazige in forum 1.x Legacy Premium Help
    Replies: 0
    Last Post: Nov 25, 2009, 8:59 AM
  5. Dynamically adding form fields
    By sz_146 in forum 1.x Help
    Replies: 4
    Last Post: Nov 11, 2008, 11:10 AM

Posting Permissions