PDA

View Full Version : [CLOSED] How I can get the similar layout in 2.0



RCM
Jun 19, 2012, 8:15 PM
Hi,

I had something like below code for login window before:



<ext:Viewport ID="vpLogin" IDMode="Explicit" runat="server" Layout="Center">
<Items>
<ext:Window ID="windowLogin" runat="server" Layout="Center">
<Items>
<ext:Hidden IDMode="Explicit" ID="txtPleaseWait" runat="server" Text="HiddenText" />
</Items>
</ext:Window>
</Items>
</ext:Viewport>


After I upgraded to 2.0, I found an issues: the window doesn't show out anymore.

I have checked change log and found that center layout is not existed anymore. So, how I can get a similar looking layout in 2.0? Please provide me an example. Many thanks.

RCM

geoffrey.mcgill
Jun 19, 2012, 8:56 PM
Hi,

Two issues:

1. Remove the <ext:Window> Component from inside the <ext:Viewport>.

2. The "Center" Layout has been removed in v2. You can use HBoxLayout. I believe there are more notes in the CHANGELOG.txt regarding this change.

Hope this helps.

Vladimir
Jun 19, 2012, 9:11 PM
You don't need Center layout for a window.
Wndow is centered automatically if X/Y coordinates are not defined

RCM
Jun 20, 2012, 12:11 PM
Hi,

Two issues:

1. Remove the <ext:Window> Component from inside the <ext:Viewport>.

2. The "Center" Layout has been removed in v2. You can use HBoxLayout. I believe there are more notes in the CHANGELOG.txt regarding this change.

Hope this helps.

But I need the window. The window is a modal one which contains logon form.

Vladimir
Jun 20, 2012, 12:15 PM
Just place the window outside Viewport.
Window is floatable widget and will be centered automatically

RCM
Jun 20, 2012, 2:08 PM
Just place the window outside Viewport.
Window is floatable widget and will be centered automatically

Yes. Thank you for the information. I saw the window is centered automatically on first load. But, if I resize IE the window is not adjusting its position to the center of resized IE. What I missed? Thanks again.

RCM

Daniil
Jun 20, 2012, 7:42 PM
I would listen the WindowResize event to center the Window.

Example

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

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE>

<html>
<head runat="server">
<title>Ext.NET v2 Example</title>
</head>
<body>
<ext:ResourceManager runat="server">
<Listeners>
<WindowResize Handler="App.Window1.center();" />
</Listeners>
</ext:ResourceManager>
<ext:Window ID="Window1" runat="server" />
</body>
</html>