[CLOSED] Initially maximized window does not restore to fixed size

  1. #1

    [CLOSED] Initially maximized window does not restore to fixed size

    In the desktop module windows with Hidden=True and Maximized=True do not restore to the fixed sizes set in the window. If Hidden= false the window will restore to the correct size but obviously shows as soon as the desktop is loaded. I would imagine the Hidden=true should work the same as the not Hidden window but as a workaround is it better to open the window normally and then maximize in code, or listen to the restore and override the height & width?

     @(
            Html.X().Window()
                .ID("WindowTest")
                .Width(1000)
                .Height(500)
                .Maximizable(true)
                .Maximized(true)
                .Hidden(false)
                .Items(Html.X().Label().Text("Window Hidden False"))
                    
        )
    
        @( Html.X().Window()
            .ID("WindowTest2")
                .Width(1000)
                .Height(500)
                .Maximizable(true)
                .Maximized(true)
                .Hidden(true)
            .Items(Html.X().Label().Text("Window2 Hidden True"))
        )
    
        @(Html.X().DesktopModuleProxy().Module(
            Html.X().DesktopModule()
            .ModuleID("WindowTestmod")
            .Shortcut(
                Html.X().DesktopShortcut()
                    .Name("open")
                    .Handler("App.WindowTest.show(this);")
                )
            )
        )
    Last edited by Daniil; Oct 22, 2014 at 8:28 AM. Reason: [CLOSED]
  2. #2
    Hi @AaronDev,

    As a solution I would suggest the following.

    If you need a Window to be hidden initially and to be maximized at the initial appearance, please keep .Hidden(true), remove .Maximized(true) and and this Show listener for the Window:

    .Listeners(events => 
    {
        events.Show.Handler = "this.maximize();";
        events.Show.Single = true;
    })
  3. #3
    Thanks Daniil

    I ended up adding maximise() as you suggest (but didn't know about .Single, very handy).
    Doesn't look great opening and then re-sizing but it's doing what I need.

    Your help is much appreciated.
  4. #4
    Doesn't look great opening and then re-sizing
    Agree. It looks there is a better workaround.

    Example

    @{
        var X = Html.X(); 
    }
    
    <!DOCTYPE html>
    <html>
    <head>
        <title>Ext.Net.MVC v2 Example</title>
    </head>
    <body>
        @X.ResourceManager()
    
        @(X.Desktop()
            .Modules(
                X.DesktopModule()
                    .ModuleID("DesktopModule1")
                    .Shortcut(X.DesktopShortcut().Name("Open").Handler("App.Window1.show(this);"))
            )
        )
    
        @(X.Window()
            .ID("Window1")
            .Title("Window")
            .Hidden(true)
            .Maximized(true)
            .Tools(X.Tool().Type(ToolType.Restore).Handler("owner.ownerCt.restore();"))
            .Listeners(events =>
            {
                events.Restore.Handler = "this.center();";
                events.Restore.Single = true;
            })
        )
    </body>
    </html>
  5. #5
    Fantastic, works perfectly

    Thanks again Daniil

Similar Threads

  1. Replies: 2
    Last Post: Jul 26, 2012, 2:12 AM
  2. [CLOSED] Problem: Closing Maximized Window will loose parent window scrollbar
    By tlfdesarrollo in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 19, 2012, 8:51 PM
  3. [CLOSED] Maximized window doesn't remain maximized
    By vadym.f in forum 1.x Legacy Premium Help
    Replies: 9
    Last Post: Feb 07, 2012, 3:32 PM
  4. [CLOSED] GridPanel Column Size Restore from Cookie
    By ecerrillos in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: Oct 29, 2010, 7:05 PM
  5. Replies: 3
    Last Post: Feb 11, 2009, 12:59 PM

Posting Permissions