PDA

View Full Version : [CLOSED] Resize Window around FormPanel



cwolcott
Mar 31, 2012, 5:30 PM
I would like a window that may hold a different page based on a button pressed, to resize to the height of the FormPanel. Any hints or out right solutions?

I have a page with a hidden window defined so that I can use it when pressing an Register, Inactivate or Edit button:



<ext:Window ID="UserPopup" runat="server" Title="Popup" Width="620" BodyPadding="10"
Resizable="false" Closable="true" Layout="FitLayout" Hidden="true" Autoheight="true">
<Loader runat="server" Mode="Frame" DisableCaching="true">
<LoadMask ShowMask="true" />
</Loader>
</ext:Window>

...

<ext:Button ID="UserRegister" runat="server" Text="Register" Icon="Add">
<Listeners>
<Click Handler="registerNewUser(#{UserPopup});" />
</Listeners>
</ext:Button>


Below is the listener code:



var registerNewUser = function (window) {

window.loader.url = './UserRegister.aspx';
window.title = 'Register New User';
window.show();
}


Below is the UserRegister.aspx page:



<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UserRegister.aspx.cs" Inherits="UserRegister" %>

<%@ 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></title>
</head>
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<body>
<ext:FormPanel ID="FormPanel1" runat="server" AutoHeight="true" BodyPadding="10"
DefaultAnchor="100%">
<Items>
<ext:FieldContainer ID="FullName" runat="server" FieldLabel="Full Name" AnchorHorizontal="100%"
Layout="HBoxLayout">
<Items>
<ext:TextField ID="FirstName" Note="First Name" NoteCls="blue-note" runat="server"
Flex="1" Margins="0 3 0 0" Vtype="alpha" AllowBlank="false" MsgTarget="Side"
IndicatorIcon="BulletRed" IndicatorTip="It is required field" />
<ext:TextField ID="LastName" Note="Last Name" NoteCls="blue-note" runat="server"
Flex="1" Vtype="alpha" AllowBlank="false" MsgTarget="Side" IndicatorIcon="BulletRed"
IndicatorTip="It is required field" />
</Items>
</ext:FieldContainer>
<ext:TextField ID="SubOrg" runat="server" Name="SubOrg" FieldLabel="Suborganization"
Vtype="alphanum" MsgTarget="Side" AllowBlank="false" IndicatorIcon="BulletRed"
IndicatorTip="It is required field" />
<ext:TextField ID="ClassEmail" runat="server" Name="CEmail" FieldLabel="SIPRNET Email"
Vtype="email" MsgTarget="Side" AllowBlank="false" />
<ext:TextField ID="UnclassEmail" runat="server" Name="UEmail" FieldLabel="Unclassified Email"
Vtype="email" MsgTarget="Side" AllowBlank="true" />
<ext:FieldContainer ID="PhoneNumbers" runat="server" FieldLabel="Phone Numbers" AnchorHorizontal="100%"
Layout="HBoxLayout">
<Items>
<ext:TextField ID="CommPhone" Note="Commercial: Include Area Code (or country/city codes, if overseas)"
runat="server" Flex="1" Margins="0 3 0 0" IndicatorIcon="BulletRed" IndicatorTip="It is required field" />
<ext:TextField ID="DsnPhone" Note="DSN" runat="server" Name="DSN" Width="60" />
</Items>
</ext:FieldContainer>
<ext:TextField ID="MailingAddress" runat="server" Name="MailingAddress" FieldLabel="Mailing Address"
Note="Street Address, City, State, Zip Code" NoteCls="blue-note" />
<ext:TextArea ID="Comments" runat="server" Name="Comments" FieldLabel="Comments" />
</Items>
<Buttons>
<ext:Button ID="Button1" runat="server" Text="Submit" />
<ext:Button ID="Button2" runat="server" Text="Cancel" />
</Buttons>
</ext:FormPanel>
</body>
</html>

Daniil
Apr 01, 2012, 5:12 PM
Hi,

Please follow:
http://forums.ext.net/showthread.php?17361&p=74694&viewfull=1#post74694

cwolcott
Apr 01, 2012, 9:23 PM
Arrgh. I hate easy solutions that I can find when surfing the forums, especially when they were posted just 6 weeks ago.
Please close thread.