Feb 03, 2012, 10:07 AM
[CLOSED] Own Difficulties with FitLayout and UserControls
Hi,
I have any difficulties with FitLayout and my own Usercontrols...
1 - I have a aspx page called Console.aspx
2 - In this page, I have a usercontrol called ExplorerWeb.ascx. This usercontrol shoult occupy the entire page... it´s work.
3 - In ExplorerWeb.ascx usercontrol, i insert another usercontrol, called ExplorerWebTab.ascx.
4 - In ExplorerWebTab.ascx, I insert a toolbar and a tabPanel... the tabPanel should occupy all 'client area' (in desktop program, was so we called the area available for a form. This term also applies to Web?).
My difficulty is: The toolbar is sized to all client area... and the tabPanel is not shown.
Thans for any help... the page and usercontrols code follow.
Console.aspx
I have any difficulties with FitLayout and my own Usercontrols...
1 - I have a aspx page called Console.aspx
2 - In this page, I have a usercontrol called ExplorerWeb.ascx. This usercontrol shoult occupy the entire page... it´s work.
3 - In ExplorerWeb.ascx usercontrol, i insert another usercontrol, called ExplorerWebTab.ascx.
4 - In ExplorerWebTab.ascx, I insert a toolbar and a tabPanel... the tabPanel should occupy all 'client area' (in desktop program, was so we called the area available for a form. This term also applies to Web?).
My difficulty is: The toolbar is sized to all client area... and the tabPanel is not shown.
Thans for any help... the page and usercontrols code follow.
Console.aspx
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Console.aspx.vb" Inherits="SuperaWeb.Console2" %>
<%@ 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>SGCO Web</title>
<link href="/Resources/Styles/ExtNet.css" rel="stylesheet" type="text/css" />
<link href="/Resources/Styles/SuperaWeb.css" rel="stylesheet" type="text/css" />
<script src="/scripts/utils.js" type="text/javascript"></script>
<script src="/scripts/format.js" type="text/javascript"> </script>
<script src="/scripts/masks.js" type="text/javascript"></script>
<script src="/scripts/validators.js" type="text/javascript"> </script>
<script src="/scripts/jsDate.js" type="text/javascript"> </script>
<ext:ResourcePlaceHolder ID="ResourcePlaceHolder1" runat="server" Mode="ScriptFiles"/>
<script src="/scripts/ExtJS.js" type="text/javascript"> </script>
<script src="/scripts/ExtNex2xWorkArrounds.js" type="text/javascript"> </script>
</head>
<body>
<ext:ResourceManager ID="resManagerSGCO" runat="server" Namespace="SuperaWeb.SGCO" />
<ext:Viewport ID="Viewport1" runat="server">
<LayoutConfig>
<ext:VBoxLayoutConfig Align="Stretch" />
</LayoutConfig>
<Items>
<ext:Panel ID="tabHeader" runat="server" Region="North" Border="false" Header="false" Height="40px">
<Content>
<%--<div id="header-console"><h1 id="h1-console"><font style='color: #15428B;'>
<ext:image runat="server" ID="imgLogo" Height="50" Width="50" style="border: 1px solid Black ; position:fixed; top:5px; left:15px;" ImageUrl="~/dbproperties/logo.jpg"/>
<asp:Label runat="server" ID="lblTitle" Text="SuperaWEB" Width="600" style="position:fixed; top:5px; left:80px;"/></font></h1>
<asp:Label runat="server" ID="lblUsuario" style="position:fixed; top:23px; right:70px;"/>
<asp:LoginStatus ID="LoginStatus1" runat="server" style="position:fixed; top:23px; right:30px;" />
<asp:Label runat="server" ID="lblEmpresa" style="position:fixed; top:42px; right:30px; color:White;"/>
</div>--%>
<div id="header-console">
<div id="h1-console">
<span id="titleempresanome" class="title-empresa-nome" style="position:fixed; top:5px; left:20px;">SuperaWeb(r)</span>
<span id="titleusuarionome" class="title-usuario-nome" style="position:fixed; top:10px; right:50px;">Usuario <a href="/app/logins/loginout.aspx" class="title-logout">(sair)</a></span>
</div>
</div>
</Content>
</ext:Panel>
<%--<ext:Panel ID="panelCenter" runat="server" Region="Center" BodyPadding="6" flex="1" Layout="FitLayout">--%>
<ext:Panel ID="panelCenter" runat="server" Region="Center" Flex="1" layout="FitLayout" BodyPadding="6">
<Items>
<ext:UserControlLoader runat="server" Path="~/app/tools/ExplorerWeb/ExplorerWeb.ascx">
</ext:UserControlLoader>
</Items>
</ext:Panel>
<ext:StatusBar runat="server" ID="stbSGCO" Region="South">
<Items>
<ext:ToolbarTextItem runat="server" AutoDataBind="true" Text="teste2" />
<ext:ToolbarSeparator runat="server" />
<ext:ToolbarTextItem ID="ToolbarTextItem1" runat="server" text="teste" />
</Items>
</ext:StatusBar>
</Items>
</ext:Viewport>
<ext:Hidden runat="server" ID="txtIDEmpresa" Text="0" /> <%--Guarda o código da empresa ativa--%>
</body>
</html>
ExplorerWeb.ascx<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="ExplorerWeb.ascx.vb" Inherits="SuperaWeb.ExplorerWeb1" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<ext:Panel ID="panelWebExplorer" runat="server" BodyStyle="background-color: #F9F9F9" Border="true" Layout="FitLayout" Flex="1">
<Items>
<ext:Toolbar ID="tbWebExplorer" runat="server">
<Items>
<ext:Button ID="btnAdd" runat="server" Icon="ApplicationAdd" Text="Adicionar"
ToolTip="Adicionar registro" />
<ext:Button ID="btnEdit" runat="server" Icon="ApplicationEdit" Text="Editar"
ToolTip="Editar registro selecionado" />
<ext:Button ID="btnDelete" runat="server" Icon="ApplicationDelete"
Text="Excluir" ToolTip="Deletar registro(s) selecionados" />
<ext:Button ID="btnFind" runat="server" Icon="Find" Text="Localizar"
ToolTip="Localizar registro" />
<ext:ToolbarSeparator ID="ctl133" runat="server" />
<ext:Button ID="btnPrint" runat="server" Icon="Printer" Text="Imprimir"
ToolTip="Imprimir registros" />
<ext:Button ID="btnPrintPreview" runat="server" Icon="PrinterGo"
Text="Visualizar impressão" ToolTip="Visualizar impressão registros" />
<ext:ToolbarSeparator ID="ToolbarSeparator1" runat="server" />
<ext:SplitButton ID="btnExport" runat="server" Icon="PageExcel" Text="Exportar"
ToolTip="Exportar registros para...">
<menu>
<ext:Menu runat="server" ID="ctl394">
<Items>
<ext:MenuItem ID="mnuExportToExcel" runat="server" icon="PageExcel"
Text="Excel" />
<ext:MenuItem ID="mnuExportToPdf" runat="server" icon="PageWhiteAcrobat"
Text="PDF" />
<ext:MenuItem ID="mnuExportToXml" runat="server" icon="PageCode" Text="Xml" />
<ext:MenuItem ID="mnuExportToText" runat="server" icon="PageWhite"
Text="Texto" />
<ext:MenuItem ID="mnuExportToHtml" runat="server" icon="Html" Text="Html" />
</Items>
</ext:Menu>
</menu>
</ext:SplitButton>
<ext:ToolbarFill ID="ctl402" />
<ext:ComboBox ID="cmbQueries" runat="server" FieldLabel="Consultas"
LabelWidth="60">
</ext:ComboBox>
</Items>
</ext:Toolbar>
<ext:TabPanel ID="tabWebExplorer" runat="server" LayoutOnTabChange="true" BodyStyle="background-color:red;" Plain="true" Flex="1">
<Items>
<ext:Panel ID="Tab1" runat="server" Title="Empresas" BodyPadding="6" Layout="FitLayout" AutoScroll="true" Flex="1" >
<Items>
<ext:UserControlLoader ID="UserControlLoader1" runat="server" Path="~/app/tools/ExplorerWeb/ExplorerWebTab.ascx" >
</ext:UserControlLoader>
</Items>
</ext:Panel>
</Items>
</ext:TabPanel>
</Items>
</ext:Panel>
ExplorerWebTab.ascx<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="ExplorerWebTab.ascx.vb" Inherits="SuperaWeb.ExplorerWebTab" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script runat="server">
Protected Sub StoreExplorerWebTab_Refresh(sender As Object, e As StoreRefreshDataEventArgs)
'Me.storeExplorerWebTab.DataSource = Me.GetData()
'Me.storeExplorerWebTab.DataBind()
End Sub
</script>
<ext:Panel runat="server" ID="panelExplorerWebTab" Layout="FitLayout" Flex="1">
<Items>
<ext:GridPanel runat="server" ID="grdExplorerWebTab" Flex="3">
<Store>
<ext:Store
runat="server"
ID="storeExplorerWebTab"
OnReadData="StoreExplorerWebTab_Refresh"
IgnoreExtraFields="false">
<Model>
<ext:Model ID="modelExplorerWebTab" runat="server">
<Fields>
<ext:ModelField Name="field1" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel>
<Columns>
<ext:Column ID="Column1" runat="server" text="field1" DataIndex="field1"/>
</Columns>
</ColumnModel>
<SelectionModel>
<ext:RowSelectionModel runat="server" ID="rsmExplorerWebTab" Mode="Single"/>
</SelectionModel>
<DirectEvents>
<%--<CellDblClick OnEvent = "ReturnRecord" Failure="Ext.MessageBox.alert('Load failed', 'Error during ajax event!');">
<EventMask ShowMask="true" Target="CustomTarget" CustomTarget="={#{grdExplorerWebTab}.body}" />
<ExtraParams>
<ext:Parameter Name="values" Value="Ext.encode(#{grdExplorerWebTab}.getRowsValues({selectedOnly:true}))" Mode="Raw" Encode="true" />
</ExtraParams>
</CellDblClick>--%>
</DirectEvents>
</ext:GridPanel>
</Items>
</ext:Panel>
Last edited by Daniil; Feb 03, 2012 at 12:04 PM.
Reason: [CLOSED]