View Full Version : [CLOSED] Window layout confusion

Apr 23, 2014, 3:44 PM
I have a mental block on a Window Layout issue.

I have a window with a Center and South region. I would like the window to resize based on the Center region controls. I have tried various attributes and am going around in circles. I know the sample code below is not correct, but it is a starting point for discussion.

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

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html>
<head runat="server">
<title>Window Fit & Border Layout</title>

<ext:ResourceManager runat="server" />
<ext:Window ID="Window04a" runat="server" Title="Window Border & Fit Layout" Layout="BorderLayout"
Width="500" Height="500" CloseAction="Destroy">
<ext:FormPanel ID="FormPanel" runat="server" ClientIDMode="Static" BodyPadding="8"
Region="Center" Layout="FitLayout" MinHeight="100">
<ext:Label runat="server" Text="Select a category the press the 'Initiate Request' button." />
<ext:Container runat="server" Html="<hr/>" MarginSpec="0 0 5 0" />
<ext:Panel runat="server" Text="Errors" Region="South" Collapsible="true" Collapsed="true" Height="100" />
<ext:Button ID="CloseBtn" runat="server" Text="Close" Icon="BulletGo" OnClientClick="#{Window04a}.close();" />

Apr 23, 2014, 4:27 PM
Unfortunatelly, it is not possible because Center region has opposite logic (center regions is fitted to occupy free space inside container)

Auto resize logic is not very reliable and almost is absent in ExtJS (I know only one property for such functionality - ShrinkWrap, but this property is ignored by mostly layouts (and window due it floating nature) because it is incompatible with layout logic)

So, I am doubt that there is a good way to make auto resize window (only if manually monitor size of required subitems and set size of the window dynamically but it can be complex task if you have complex UI inside the window)