[CLOSED] ext:Window Loader Autosize

  1. #1

    [CLOSED] ext:Window Loader Autosize

    Hi!

    I am creating my Form Details as aspx pages.

    I'm loading these Form Details in a ext:Window with Loader tag.
    <ext:Window ID="wndDetails" runat="server" Icon="ApplicationFormEdit" Resizable="false" Hidden="true" Modal="true" Constrain="true" Width="400" Height="300">
                <Loader runat="server" AutoLoad="true" Url="~/default.aspx" Mode="Frame" TriggerEvent="show" ReloadOnEvent="true">
                    <LoadMask Msg="Carregando..." ShowMask="true" />
                        <Params>
                            <ext:Parameter Name="ID" Value="" Mode="Value" />
                        </Params>
                    </Loader>
            </ext:Window>
    I wish the ext: Window automatically adjusts to itself to its contents. It's possible?

    Thanks for any help!
    Last edited by Daniil; Feb 17, 2012 at 2:26 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Please use a Viewport with Layout="FitLayout" as a top level container within the ASPX page that you load into the Window. Then that Viewport will occupy a whole Window's space.
  3. #3
    Hi Daniil... thanks for your reply

    I think the solution is not good for me.

    I'll have Form Details with only two form fields and other Form Details with dozens of fields.

    Alternatively, I thought I'd create a directmethod in the mainpage and call this method in formdetails where I pass the height and width.

    What do you think? have a better idea?
  4. #4
    I got the requirement now.

    Well, there is no such built-in functionality.

    I can suggest the following solution.

    Example Parent Page
    <%@ Page Language="C#" %>
    
    <%@ 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>Ext.NET v2 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="Test.aspx" />
            </ext:Window>
        </form>
    </body>
    </html>
    Example Child Page
    <%@ Page Language="C#" %>
    
    <%@ 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>Ext.NET v2 Example</title>
    </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 
                        Handler="var win = parentAutoLoadControl.target || parentAutoLoadControl, //you can use just 'parentAutoLoadControl' after update to Ext.NET v2 beta.
                                     size = this.getSize();
    
                                 size.height += 34;
                                 size.width += 12;
                                 win.setSize(size);" 
                        Delay="100" />
                </Listeners>
            </ext:FormPanel>
        </form>
    </body>
    </html>
  5. #5
    Hi Daniil!

    Thanks a lot for your help! Works very fine.

    Now, I need center the window in screen... New thread?
  6. #6
    It's rather a minor thing, I don't think the new thread is required.

    Please use the Window's center method.
    win.setSize(size);
    win.center();
  7. #7
    Perfect!

    Thanks a lot for your help!
  8. #8

    Not resizing!

    Hello,

    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! Would you help me? Thanks!
  9. #9
    Hello @banrisulssw! Welcome to Ext.NET forums!

    Would you mind creating a new thread about this problem (and probably mentioning this thread) in the appropriate 4.x forums?
    Fabrício Murta
    Developer & Support Expert
  10. #10
    Thanks!

    Yes, i opened a new thread in the 4.1 forum!

Similar Threads

  1. [CLOSED] Loader with Html renderer and Window rendering
    By paulc in forum 2.x Premium Help
    Replies: 33
    Last Post: Jun 25, 2013, 8:43 AM
  2. Replies: 5
    Last Post: Feb 17, 2012, 2:27 PM
  3. Help! usercontrol do't autosize
    By st.leo in forum 1.x Help
    Replies: 2
    Last Post: Nov 15, 2010, 7:27 AM
  4. Replies: 0
    Last Post: Apr 23, 2010, 8:20 AM
  5. [CLOSED] Autosize Grids
    By CMA in forum 1.x Premium Help
    Replies: 2
    Last Post: Apr 07, 2010, 12:35 PM

Tags for this Thread

Posting Permissions