PDA

View Full Version : [CLOSED] Window layout confusion



cwolcott
Apr 23, 2014, 4: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>
<html>
<head runat="server">
<title>Window Fit & Border Layout</title>

</head>
<body>
<ext:ResourceManager runat="server" />
<ext:Window ID="Window04a" runat="server" Title="Window Border & Fit Layout" Layout="BorderLayout"
Width="500" Height="500" CloseAction="Destroy">
<Items>
<ext:FormPanel ID="FormPanel" runat="server" ClientIDMode="Static" BodyPadding="8"
Region="Center" Layout="FitLayout" MinHeight="100">
<Items>
<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" />
</Items>
</ext:FormPanel>
<ext:Panel runat="server" Text="Errors" Region="South" Collapsible="true" Collapsed="true" Height="100" />
</Items>
<Buttons>
<ext:Button ID="CloseBtn" runat="server" Text="Close" Icon="BulletGo" OnClientClick="#{Window04a}.close();" />
</Buttons>
</ext:Window>
</body>
</html>

Vladimir
Apr 23, 2014, 5: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)