PDA

View Full Version : [CLOSED] panels fit completely in a window



marco.morreale
May 31, 2012, 8:43 AM
Hi,
can you show me the best way to get two horizontally aligned panels fit completely in a window?
Thanks in advance.
M



<ext:Window
ID="wGrigliaPoteri"
runat="server"
Title="Griglia dei poteri"
Icon="Application"
Height="500"
Width="800"
BodyStyle="background-color: #fff;"

Modal="true"
Hidden="true"
Layout="ColumnLayout"
>
<Listeners>
<Show Handler="#{stPotere}.load();"></Show>
</Listeners>
<Content>
<ext:Panel
runat="server"
Height="400"
Title="Negativi"
Layout="ColumnLayout"
ColumnWidth="0.5"
>
<Items>
<ext:Panel
runat="server"
ColumnWidth="0.34"
ID="NegCol1"
FrameHeader="false"
Border="false"
Padding="5"
/>
<ext:Panel
runat="server"
ColumnWidth="0.33"
ID="NegCol2"
FrameHeader="false"
Border="false"
Padding="5"
/>
<ext:Panel
runat="server"
ColumnWidth="0.33"
ID="NegCol3"
FrameHeader="false"
Border="false"
Padding="5"
/>
</Items>
</ext:Panel>
<ext:Panel
runat="server"
Title="Positivi"
Height="400"
Layout="ColumnLayout"
ColumnWidth="0.5"
>
<Items>
<ext:Panel
runat="server"
ColumnWidth="0.34"
ID="PosCol1"
FrameHeader="false"
Border="false"
Padding="5"
/>
<ext:Panel
runat="server"
ColumnWidth="0.33"
ID="PosCol2"
FrameHeader="false"
Border="false"
Padding="5"
/>
<ext:Panel
runat="server"
ColumnWidth="0.33"
ID="PosCol3"
FrameHeader="false"
Border="false"
Padding="5"
/>
</Items>
</ext:Panel>
</Content>
<Buttons>
<ext:Button ID="AddToCartFromGrid" runat="server" Text="Aggiungi al Carrello" Icon="CartAdd" >
<DirectEvents>
<Click OnEvent="AddToCartFromGrigliaPoteri" ></Click>
</DirectEvents>
<Listeners>
<Click Handler="#{gpBasket}.store.load();" />
</Listeners>
</ext:Button>
</Buttons>
</ext:Window>

Daniil
May 31, 2012, 2:36 PM
Hi,

Please use HBoxLayout.

Example

<%@ Page Language="C#" %>

<%@ 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>Ext.NET v2 Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />
<ext:Window
runat="server"
Width="500"
Height="500"
Layout="HBoxLayout">
<LayoutConfig>
<ext:HBoxLayoutConfig Align="Stretch" />
</LayoutConfig>
<Items>
<ext:Panel runat="server" Flex="1" BodyStyle="background-color: green;" />
<ext:Panel runat="server" Flex="1" BodyStyle="background-color: yellow;" />
</Items>
</ext:Window>
</form>
</body>
</html>

marco.morreale
May 31, 2012, 2:43 PM
It works.
Thank you.
M