[CLOSED] FieldLabel on non field controls

  1. #1

    [CLOSED] FieldLabel on non field controls

    In Ext 1.3 I am using the FieldLabel property on Panels, Labels and Buttons - mostly as a simple tool to help align UserControls and so on with other standard form controls such as TextFields e.g.


    <ext:Panel ID="pnlA" runat="server" Border="false" Layout="FormLayout">
      <Items>
        <ext:TextField ID="txtB" runat="server" FieldLabel="My Textbox" />
        <ext:Label ID="lblC" runat="server" FieldLabel="My Label" />
        <ext:Checkbox ID="chkIsEnabled" runat="server" BoxLabel="Check me" />
        <ext:Button ID="btnUpdateName" runat="server" FieldLabel="Perform Action">
        </ext:Button>
        <ext:Panel ID="pnlB" runat="server" FieldLabel="Label for UC">
          <Content>
          User control or other nested content here
          </Content>
        </ext:Panel>
      </Items>
    </ext:Panel>

    In attempting to upgrade to 2.0 I see that FieldLabel is no longer available for Label, Button, Panel and other controls that don't inherit from the Field base class.


    My question is - What is the recommended design pattern to get custom "non field" content both aligned with and labelled identically to regualr field controls in a FormLayout/AnchorLayout scenario.


    (Also ChangeLog says "75. FormLayout has been removed. Use AnchorLayout." but FormLayout is still in the examples)
    Last edited by Daniil; Jun 07, 2012 at 3:30 PM. Reason: [CLOSED]
  2. #2
    Hi,

    I would use a FieldContainer.

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.NET v2 Example</title>
    </head>
    <body>
        <ext:ResourceManager runat="server" />
        <ext:Panel runat="server" Layout="FormLayout">
            <Items>
                <ext:TextField runat="server" FieldLabel="TextField" />
                <ext:Label runat="server" FieldLabel="Label" />
                <ext:Checkbox runat="server" BoxLabel="Check me" FieldLabel="Checkbox" />
                <ext:FieldContainer runat="server" FieldLabel="Button">
                    <Items>
                        <ext:Button runat="server" Text="Click me" />
                    </Items>
                </ext:FieldContainer>
                <ext:FieldContainer runat="server" FieldLabel="User control">
                    <Items>
                        <ext:Panel runat="server">
                            <Content>
                                User control or other nested content here
                            </Content>
                        </ext:Panel>
                    </Items>
                </ext:FieldContainer>
            </Items>
        </ext:Panel>
    </body>
    </html>
    (Also ChangeLog says "75. FormLayout has been removed. Use AnchorLayout." but FormLayout is still in the examples)
    Yes, ti has returned. Thanks for the report, we will remove that item.
  3. #3
    Thanks Daniil

Similar Threads

  1. [CLOSED] Auto FieldLabel with static field width?
    By softmachine2011 in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Aug 01, 2012, 9:02 AM
  2. [CLOSED] the Field 's FieldLabel don't display
    By lonely7345 in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 13, 2011, 7:47 PM
  3. [CLOSED] [1.0] Composite field FieldLabel property
    By tansu in forum 1.x Legacy Premium Help
    Replies: 21
    Last Post: Aug 09, 2010, 10:58 AM
  4. [CLOSED] FieldLabel for Items inside Composite Field
    By amitpareek in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: May 07, 2010, 7:46 AM
  5. How to adjust the distance of fieldlabel and field?
    By GeoffreyRen in forum 1.x Help
    Replies: 2
    Last Post: Jun 23, 2009, 3:12 AM

Tags for this Thread

Posting Permissions