PDA

View Full Version : [CLOSED] FitLayout and Master Page problem



marco.morreale
Sep 13, 2012, 3:10 PM
Hi,
I am building a web portal with the following requirements:
- fixed body with of 1024px
- grids should fill up 100% vertical space using scrolling

Watching previous got the following files.

<uc4:TestForm ID="TestForm1" runat="server" />
<uc1:TestGrid ID="TestGrid1" runat="server" />

TestForm1 and TestGrid1 are simple user controls containing respectively a form example and a grid example.

The problem is that if the grid is inside a contentPlaceholder is not displayed.
The grid works correctly if I put it directly in master page (insted of aspx file); please, see attached image.

4772


If you can suggest a better way to accomplish this it is very welcome.
Thanks in advance

M

ExtNetTest.Master



<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="ExtNetTest.master.cs" Inherits="renosistemi.it.MasterPages.ExtNetTest" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<%@ Register src="~/Controls/HeaderReno.ascx" tagname="HeaderReno" tagprefix="uc2" %>
<%@ Register src="~/Controls/TestGrid.ascx" tagname="TestGrid" tagprefix="uc1" %>
<%@ Register src="~/Controls/Footer.ascx" tagname="Footer" tagprefix="uc3" %>

<!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 id="Head1" runat="server">
<title></title>
</head>
<body>
<form id="form2" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:Viewport ID="Viewport1" runat="server" Layout="HBoxLayout" BodyStyle="background-color: transparent;" >
<LayoutConfig>
<ext:HBoxLayoutConfig Pack="Center" Align="Stretch" />
</LayoutConfig>
<Items>

<ext:Container ID="mainContainer" runat="server" Width="1024" Layout="BorderLayout" StyleSpec="background-color: transparent;">
<Content>
<ext:Panel
ID="btns"
runat="server"
Region="Center"
Layout="FitLayout"
Border="false"
BodyStyle="background-color: transparent;"
>
<Items>
<ext:Panel
ID="pnlFlexStretch"
runat="server"
Layout="VBoxLayout"
Border="false"
BodyStyle="background-color: transparent;"
>
<LayoutConfig>
<ext:VBoxLayoutConfig Align="Stretch" />
</LayoutConfig>
<Items>
<ext:Container ID="headerCtrlContainer" runat="server" Flex="2" StyleSpec="background-color: transparent;" >
<Content>
<uc2:HeaderReno ID="HeaderReno1" runat="server" />
</Content>
</ext:Container>
<ext:Container ID="staticContent" runat="server" Flex="6" StyleSpec="background-color: transparent;" >
<Content>
<asp:ContentPlaceHolder ID="cpStaticContent" runat="server"></asp:ContentPlaceHolder>
</Content>
</ext:Container>
<ext:Container ID="flexContainer" runat="server" Flex="10" Layout="FitLayout" StyleSpec="background-color: transparent;" >
<Content>
<asp:ContentPlaceHolder ID="cpFlexContainer" runat="server"></asp:ContentPlaceHolder>
</Content>
</ext:Container>
<ext:Panel ID="footerCtrlContainer" runat="server" Flex="1" Border="false" StyleSpec="background-color: transparent;" >
<Content>
<uc3:Footer ID="Footer1" runat="server" />
</Content>
</ext:Panel>

</Items>
</ext:Panel>
</Items>
</ext:Panel>
</Content>
</ext:Container>
</Items>
</ext:Viewport>

</form>
</body>
</html>





Test2.aspx




<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/MasterPages/ExtNetTest.Master" CodeBehind="Test6.aspx.cs" Inherits="renosistemi.it.Test6" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<%@ Register src="~/Controls/TestGrid.ascx" tagname="TestGrid" tagprefix="uc1" %>
<%@ Register src="~/Controls/TestForm.ascx" tagname="TestForm" tagprefix="uc4" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cpStaticContent" runat="server">
<uc4:TestForm ID="TestForm1" runat="server" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpFlexContainer" runat="server">
<uc1:TestGrid ID="TestGrid1" runat="server" />
</asp:Content>

Daniil
Sep 13, 2012, 8:50 PM
Hi,

The problem is the fact that a GridPanel from the user control doesn't become an item of the flexContainer container. It is rendered as raw HTML. So, FitLayout doesn't affect it.

To avoid it, please wrap a user control in an additional <ext:Container> with FitLayout.

marco.morreale
Sep 14, 2012, 8:04 AM
It works.
Thanks, Daniil.
M