PDA

View Full Version : [CLOSED] Layout border in usercontrol



ViDom
Sep 28, 2012, 9:15 AM
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=g3d002321e26c27851511210b3108bf2be25ec5

Thanks,
ViDom

Daniil
Sep 28, 2012, 11:38 AM
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.

ViDom
Sep 28, 2012, 12:25 PM
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:)