View Full Version : [CLOSED] ColumnLayout in Viewport Frustration

Jan 29, 2014, 12:04 AM
All I want is for a panel with columnlayout to take up the full screen for all columns. Putting it inside a viewport with layout = fitlayout seemingly is the right solution (isn't that what fitlayout is for???). But when I do that, the column panels each only take up the height of what is in the panel and no more.

Here's a very simple example to show what I mean:

<ext:Viewport ID="Viewport1" runat="server" Layout="FitLayout">
<ext:Panel ID="columns" runat="server" Layout="ColumnLayout">
<ext:Panel runat="server" ColumnWidth="0.5" Border="true" Html="West Gutter">
<ext:Panel runat="server" Width="1000" Html="Center"></ext:Panel>
<ext:Panel runat="server" ColumnWidth="0.5" Border="true" Html="East Gutter"></ext:Panel>

I've tried a Border Layout, but it has to have defined widths for the west and east, but they are just gutters for the content in the middle, which should be of defined width, so that's out. Please help! Frustrations abound. Essentially, I'm trying to get the code rewritten in v2.x for the attached example.


Jan 29, 2014, 3:53 AM
Personally I'd use the HBoxLayout instead of ColumnLayout. ColumLayout has basically been deprecated in 2.x, in favour of using HBoxLayout.

The following sample demonstrates your sample reconfigured to use HBoxLayout.


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

<!DOCTYPE html>

<head runat="server">
<title>Ext.NET Example</title>
<form runat="server">
<ext:ResourceManager runat="server" />

<ext:Viewport runat="server" Layout="FitLayout">
<ext:Panel runat="server" Title="Main" Layout="HBoxLayout">
<ext:HBoxLayoutConfig Align="Stretch" />
<ext:Panel runat="server" Flex="1" Border="true" Html="West Gutter" />
<ext:Panel runat="server" Width="1000" Html="Center" />
<ext:Panel runat="server" Flex="1" Border="true" Html="East Gutter" />

Hope this helps.

Jan 29, 2014, 7:50 PM
It helps. That's exactly what I did to get it working. Thanks so much!

Feel free to mark as solved.