[CLOSED] Window with loader not resizing after render!

  1. #1

    [CLOSED] Window with loader not resizing after render!

    Hello!

    The issue is the same on the thread #17361!

    This solution it works perfectly on older version of ext.net, but when i changed to the new version (4.1), stopped working, the parent window is not resizing!

    The browser returns the error "Uncaught ReferenceError: parentAutoLoadControl is not defined".

    Would you help me? Thanks!
    Last edited by fabricio.murta; Sep 06, 2016 at 6:46 PM.
  2. #2
    Hello @banrisulssw!

    Sure! We're here to help!

    So, all you had to change is instead of using cryptic parentAutoLoadControl, use JavaScript's window.parent reference.

    A bit more about this here:
    - Window.parent - Web APIs | MDN
    - Window parent property - w3schools

    And the example would become:
    - 61414-parentPage.aspx -

    <%@ Page Language="C#" %>
    
    <!DOCTYPE html>
    
    <html>
    <head runat="server">
        <title>Ext.NET v4 Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:Window 
                ID="Window1" 
                runat="server" 
                Shadow="false">
                <Loader 
                    runat="server" 
                    Mode="Frame" 
                    Url="61414-childPage.aspx" />
            </ext:Window>
        </form>
    </body>
    </html>
    - 61414-childPage.aspx -

    <%@ Page Language="C#" %>
    
    <!DOCTYPE html>
    
    <html>
    <head runat="server">
        <title>Ext.NET v2 Example</title>
        <script type="text/javascript">
            var afterRenderHandler = function (item) {
                var win = window.parent.App.Window1,
                    size = this.getSize();
    
                size.height += 46;
                size.width += 4;
                win.setSize(size);
            }
        </script>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:FormPanel 
                runat="server" 
                Width="300" 
                DefaultAnchor="100%" 
                Border="false" >
                <Items>
                    <ext:TextField runat="server" FieldLabel="TextField" />
                    <ext:TextField runat="server" FieldLabel="TextField" />
                </Items>
                <Listeners>
                    <AfterRender 
                        Fn="afterRenderHandler"
                        Delay="100" />
                </Listeners>
            </ext:FormPanel>
        </form>
    </body>
    </html>
    Notice the relative size change depends directly on which theme you are using, the values of 46, 4 on lines 13 and 14 respectively, fits the Triton theme, while the values you see in the original topic probably match the Gray theme.

    Hope this helps!
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Thanks a lot Fabricio!

    Works perfectly!
  4. #4
    Glad it helped, thanks for the feedback!
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. Replies: 2
    Last Post: Jun 13, 2014, 9:52 AM
  2. Replies: 5
    Last Post: Jun 12, 2013, 2:49 AM
  3. [CLOSED] Displaying Error After Resizing the window
    By imaa in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jul 27, 2011, 9:38 AM
  4. resizing panel to 100% of Ext.Window
    By principal_X in forum 1.x Help
    Replies: 2
    Last Post: Jun 09, 2009, 3:30 PM
  5. Center ext:window on window resizing
    By matteo in forum Examples and Extras
    Replies: 1
    Last Post: Oct 02, 2008, 11:35 PM

Tags for this Thread

Posting Permissions