[CLOSED] Layout border in usercontrol

  1. #1

    [CLOSED] Layout border in usercontrol

    Hi,

    I've made simple project to show what's my problem.

    Here's code

    page.master
    <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Page.master.cs" Inherits="TestExt20.Page" %>
    
    <%@ 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></title>
        <asp:ContentPlaceHolder ID="head" runat="server">
        </asp:ContentPlaceHolder>
    </head>
    <body>
        <form id="form1" runat="server">
            <ext:ResourceManager runat="server"></ext:ResourceManager>
            <ext:Viewport runat="server">
                <LayoutConfig>
                    <ext:VBoxLayoutConfig runat="server" Align="Stretch"/>
                </LayoutConfig>
                <Items>
                    <ext:Container runat="server" Height="70">
                        <LayoutConfig>
                            <ext:VBoxLayoutConfig runat="server" Align="Stretch"/>
                        </LayoutConfig>
                        <Items>
                            <ext:Container runat="server" Height="40">
                                <Content>
                                    Top
                                </Content>
                            </ext:Container>
                            <ext:Toolbar runat="server" Height="30">
                                <Items>
                                    <ext:Button runat="server" Text="Start" OnClientClick="window.location.href='Start.aspx'"></ext:Button>
                                    <ext:Button runat="server" Text="BorderControl" OnClientClick="window.location.href='Border.aspx'"></ext:Button>
                                </Items>
                            </ext:Toolbar>
                        </Items>
                    </ext:Container>
                    <ext:Container runat="server" Layout="Fit">
                        <Content>
                            <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
            
                            </asp:ContentPlaceHolder>
                        </Content>
                    </ext:Container>
                </Items>
            </ext:Viewport>
        </form>
    </body>
    </html>
    pages
    <%@ Page Title="" Language="C#" MasterPageFile="~/Page.Master" AutoEventWireup="true" CodeBehind="Start.aspx.cs" Inherits="TestExt20.Start" %>
    <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    </asp:Content>
    <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
        Start
    </asp:Content>
    
    <%@ Page Title="" Language="C#" MasterPageFile="~/Page.Master" AutoEventWireup="true" CodeBehind="Border.aspx.cs" Inherits="TestExt20.Border" %>
    <%@ Register assembly="Ext.Net" namespace="Ext.Net" tagPrefix="ext" %>
    <%@ Register tagPrefix="uc" tagName="DicForm" src="controls/DicForm.ascx" %>
    <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    </asp:Content>
    <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
        <ext:Container runat="server" Layout="Fit"><%-- how should I act here? Layout doesn't affect Content what I'm aware of --%>
            <Content>
                <uc:DicForm ID="dicForm" runat="server">
                </uc:DicForm>
            </Content>
        </ext:Container>
    </asp:Content>
    user control
    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="DicForm.ascx.cs" Inherits="TestExt20.controls.DicForm" %>
    <%@ Register assembly="Ext.Net" namespace="Ext.Net" tagPrefix="ext" %>
    
    <ext:Container runat="server" ID="Border" Layout="Border">
        <Items>
            <ext:Container runat="server" Region="North" Height="30">
                <Items>
                    <ext:Button runat="server" Text="btn north control"></ext:Button>
                </Items>
            </ext:Container>
            <ext:Container runat="server" Region="Center" Layout="Fit">
                <Items>
                    <ext:TextField runat="server" Text="center control"></ext:TextField>
                </Items>
            </ext:Container>
            <ext:TabPanel runat="server" Layout="Fit" Region="South" Height="300" Collapsed="True" Collapsible="true">
                <Items>
                    <ext:Panel runat="server" Title="Tab1"></ext:Panel>
                </Items>
            </ext:TabPanel>
        </Items>
    </ext:Container>
    and here is entire solution for faster investigation.

    http://www.fileconvoy.com/dfl.php?id...3108bf2be25ec5

    Thanks,
    ViDom
    Last edited by Daniil; Sep 28, 2012 at 11:30 AM. Reason: [CLOSED]
  2. #2
    Hi @ViDom,

    I think you just need to set
    Flex="1"
    for the Container of the Viewport.

    VBoxLayout requires explicit Height or Flex options of its items.
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi @ViDom,

    I think you just need to set
    Flex="1"
    for the Container of the Viewport.

    VBoxLayout requires explicit Height or Flex options of its items.
    @Daniil Thanks a lot.
    I've totally forgot about that requirement :(
    Now It's start working:)

Similar Threads

  1. border layout inside of tab
    By craig2005 in forum 1.x Help
    Replies: 1
    Last Post: Dec 31, 2010, 8:58 PM
  2. Collapsed border layout Region
    By rajputamit in forum 1.x Help
    Replies: 1
    Last Post: Oct 30, 2010, 4:02 PM
  3. Border Layout not getting collapsed
    By vivekrane1986 in forum 1.x Help
    Replies: 0
    Last Post: Jun 05, 2010, 6:23 AM
  4. [CLOSED] Need help with Border layout
    By Jurke in forum 1.x Premium Help
    Replies: 2
    Last Post: May 29, 2009, 9:05 AM
  5. Border Layout
    By oskarni in forum 1.x Help
    Replies: 7
    Last Post: Apr 10, 2008, 9:19 PM

Tags for this Thread

Posting Permissions