[CLOSED] Container HBoxLayout

  1. #1

    [CLOSED] Container HBoxLayout

    Hello,
    I am trying to left align one DisplayField, and right align the second one, but I couldn't get it working. The second label doesn't respect the parent container's width (900px). What's wrong?

    Thank you!

    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
            }
        }
    
    </script>
    
    <!DOCTYPE html>
    
    <html>
    <head runat="server">
        <title></title>
    
        <script type="text/javascript">
        </script>
    
    </head>
    <body>
        <ext:ResourceManager runat="server" />
    
        <ext:FormPanel ID="FormPanel1" runat="server" Frame="True" MinHeight="200" Border="False" Layout="Form" BodyPadding="10" ButtonAlign="Left" AutoScroll="True">
            <Items>
                <ext:Container runat="server" Layout="HBoxLayout" Width="900" StyleSpec="background-color:#aaa;" >
                    <Items>
                        <ext:DisplayField runat="server" ID="DF1" FieldLabel="Label1" Text="13456"></ext:DisplayField>
                        <ext:Component runat="server" Flex="1" />
                        <ext:DisplayField runat="server" ID="DF2" FieldLabel="Label2" Text="ABCDE" ></ext:DisplayField>
                    </Items>
                </ext:Container>
            </Items>
        </ext:FormPanel>
    </body>
    </html>
    Last edited by Daniil; Nov 19, 2015 at 6:23 AM. Reason: [CLOSED]
  2. #2
    Hi @exe,

    I am not sure why, but if change Layout="Form" to Layout="AnchorLayout", it starts working.
  3. #3
    Hi,
    it's not a solution for me, because in my real application I have a huge form with many fields and containers, so I really need a FormPanel. Is there any other way to have some controls left aligned and some right aligned on the same "row"?

    Thanks!
  4. #4
    You can still use a FormPanel, but with Layout="AnchorLayout".
    <ext:FormPanel runat="server" Layout="AnchorLayout" ...>
    Please clarify is the layout broken with that change?
  5. #5
    It's ok with AnchorLayout ;)

    Thx!

Similar Threads

  1. how to use HBoxLayout with columnlayout
    By milindb023 in forum 3.x Help
    Replies: 1
    Last Post: Aug 21, 2015, 11:05 AM
  2. Replies: 3
    Last Post: Oct 23, 2013, 3:30 PM
  3. HBoxLayout, how to set scrollbar
    By Aod47 in forum 1.x Help
    Replies: 0
    Last Post: Aug 14, 2012, 8:16 AM
  4. About [ColumnLayout] and [HBoxLayout]...
    By kabalkunz in forum 1.x Help
    Replies: 4
    Last Post: Jan 17, 2012, 3:13 PM
  5. Replies: 2
    Last Post: May 23, 2011, 8:46 PM

Tags for this Thread

Posting Permissions