PDA

View Full Version : [CLOSED] windows position of big windows



lbrohan
Jan 04, 2021, 10:06 AM
Hello, is there a way how to display window from the top of the page?

probably best if you check this example



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

<!DOCTYPE html>

<html>
<head runat="server">
<title>Show/hide components according to value - Ext.NET Examples</title>
</head>
<body>

<form runat="server">
<ext:ResourceManager runat="server" />

<h1>Window test</h1>

<ext:Window runat="server" Scrollable="Both" MaxHeight="2000" Width="500">
<Items>
<ext:DisplayField runat="server" Text="Hidden text"></ext:DisplayField>
<ext:Panel runat="server" Height="3000">

</ext:Panel>
</Items>
</ext:Window>
</form>
</body>
</html>


top part of the window is hidden (which I'm finw with) but thereis no way how the user can get to it (any kind of scrolling)

ideaaly if window title is rendered at the top edge of the browser, so everything would be visible

(I know that I can set height of the window according available space as a workaround)

Thanks

fabricio.murta
Jan 05, 2021, 7:00 AM
Hello @ibrohan!

Here you go:



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

<!DOCTYPE html>

<html>
<head runat="server">
<title>Show/hide components according to value - Ext.NET Examples</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />

<ext:Viewport runat="server" Scrollable="Both">
<Items>
<ext:Label runat="server" Html="<h1>Window test</h1>" />
<ext:Window runat="server" Scrollable="Both" MaxHeight="2000" Width="500" ConstrainHeader="true">
<Items>
<ext:DisplayField runat="server" Text="Hidden text"></ext:DisplayField>
<ext:Panel runat="server" Height="3000" />
</Items>
</ext:Window>
</Items>
</ext:Viewport>
</form>
</body>
</html>


Thanks by the way for noting you don't want the window to just fit on screen, that'd be the obvious answer here.

It is always a good idea to use a viewport in pages to help handling what's on screen. Most examples explorer samples won't employ it just for the sake of simplicity.

In the example, I just added the Viewport component, specifying it should be scrollable whenever contents don't fit in. Then I set window's ConstrainHeader to ensure window header is always visible in the viewport no matter what (you can scroll it out of view but it will always be reachable from within the viewport).

This constrained setting is specially interesting as it won't allow the user to move the window outside the viewport and make it (again) unable to be seen.

Hope this helps!

lbrohan
Jan 05, 2021, 7:48 AM
ok perfect, clear and undestable,
thanks a lot, please close this thread

fabricio.murta
Jan 05, 2021, 7:54 AM
Thanks for the kind feedback, and glad it helped!