Setting Button width in FormLayout window for a button outside the Buttons tag

  1. #1

    Setting Button width in FormLayout window for a button outside the Buttons tag

    Hi, this is my first post on these forums.
    Is it possible to have a button that will not take up the whole line in a FormLayout window?

    For example the last Item in the Items tag.
    In any case, I don't want this button to be next to the other two because it is related mainly to the form.

    <ext:Window 
                ID="Window_AssignVariables" 
                runat="server"
                Height="600"
                Width="800"
                Title="Assign Variables/Values"
                BodyStyle="background-color: #fff;" 
                BodyPadding="5"
                Modal="true"
                Hidden="true" 
                Resizable="false"
                Layout="FormLayout" 
                ButtonAlign="Center"
                Closable="false">
            <Items>
                <ext:TextField ID="TextField_ChangedInSP" runat="server" EmptyText="Changed In SP"/>
                <ext:TextArea ID="TextArea_CommentInput" runat="server" EmptyText="Set to Comment Input"/>
                <ext:Button runat="server" ID="Button_AssignVariables_Clear" Text="Clear" Icon="Erase"  />
            </Items>
    
            <Buttons>
                <ext:Button ID="Button_AssignVariables_OK" runat="server" Text="OK" >
                    <DirectEvents>
                        <Click OnEvent="Window_AssignVariables_OK" />
                    </DirectEvents>
                </ext:Button>
                <ext:Button ID="Button_AssignVariables_Cancel" runat="server" Text="Cancel" >
                    <DirectEvents>
                        <Click OnEvent="Window_AssignVariables_Cancel" />
                    </DirectEvents>
                </ext:Button>
            </Buttons>
        </ext:Window>
  2. #2
    Just use Anchor layout
    <%@ Page Language="C#" %>
    
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <!DOCTYPE html>
    
    
     
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Test</title>
    </head>
    <body>
        <form id="form1" runat="server">
            <ext:ResourceManager runat="server" ID="ResourceManager1" Theme="Gray" />
            <ext:Window
                ID="Window_AssignVariables"
                runat="server"
                Height="600"
                Width="800"
                Title="Assign Variables/Values"
                BodyStyle="background-color: #fff;"
                BodyPadding="5"
                Modal="true"
                Resizable="false"
                Layout="AnchorLayout"
                ButtonAlign="Center"
                Closable="false">
            <Items>
                <ext:TextField ID="TextField_ChangedInSP" runat="server" EmptyText="Changed In SP" Anchor="100%" />
                <ext:TextArea ID="TextArea_CommentInput" runat="server" EmptyText="Set to Comment Input"  Anchor="100%" />
                <ext:Button runat="server" ID="Button_AssignVariables_Clear" Text="Clear" Icon="Erase"  />
            </Items>
     
            <Buttons>
                <ext:Button ID="Button_AssignVariables_OK" runat="server" Text="OK" >
                </ext:Button>
                <ext:Button ID="Button_AssignVariables_Cancel" runat="server" Text="Cancel" >
                </ext:Button>
            </Buttons>
        </ext:Window>
        </form>
    </body>
    </html>
  3. #3
    Quote Originally Posted by Vladimir View Post
    Just use Anchor layout
    But then all my other elements do not fill up the rows and instead stick the to left of the window.
    I only want this kind of behavior for my button, not everything in the window.
  4. #4
    See my example, use Anchor or AnchorHorixontal with 100%
    Anchor="100%"
  5. #5
    Thank you Vladimir, this works indeed.

    Is there a property if I want to set the button alignment to the right side of the form instead of left?

Similar Threads

  1. Button width
    By dan182 in forum 1.x Help
    Replies: 9
    Last Post: Feb 11, 2011, 9:56 AM
  2. Replies: 2
    Last Post: Nov 10, 2010, 11:04 PM
  3. Button Width - help!!!
    By Tbaseflug in forum 1.x Help
    Replies: 5
    Last Post: May 05, 2010, 2:52 PM
  4. Replies: 3
    Last Post: Feb 02, 2010, 6:32 PM
  5. Button Width
    By Vlad in forum 1.x Help
    Replies: 3
    Last Post: Jun 09, 2008, 7:42 PM

Tags for this Thread

Posting Permissions