[CLOSED] Best solution for show window

  1. #1

    [CLOSED] Best solution for show window

    Hello,

    I have some pages with 4 to 5 window controls.

    I use your scenario:
    1) Usercontrol (for example Test.ascx) in which I make window with other Ext controls
     
    <ext:WindowID="frmWindow"runat="server">
    ...
    </ext:Window>
    2) I .aspx page I register control
     
    <%@RegisterSrc="Test.ascx"TagName="TestCtl"TagPrefix="uc1" %>
    and

     
    <uc1:TestCtlID="TestCtl1"runat="server"/>
    3) In codebegin .aspx page I call method for showing window

     
    this.TestCtl1.Show();
    This works OK if I have one simple window, but I have few .apsx pages with more heavy Ext window controls (declared in similar
    usercontrols as above) and this slows page load.

    My questions are:
    1) Does a better way for this problem exist? I know for one solution of one Ext window control in page and using Mode="IFrame" and
    AutoLoad option, but in this scenario I must dynamicaly resize window and after closing window it must still exist.

    2) I want that my .apsx page are lightweight as possible, that I can call and show window on demand (declared in usercontrol), and
    that after closing this window is destroyed. Is this possible?

    Can you suggest or provide some examples for this problem?


    Best regards,
    Sasa
    Last edited by geoffrey.mcgill; Feb 18, 2011 at 10:01 PM. Reason: [CLOSED]
  2. #2
    Hi Sasa,

    If you are loading UserControls directly on the Page during its initialization (or Page_Load), the script/html used to generate the Component in those UserControls is added to the main page. The larger the UserControl, the larger the main page... this you have discovered.

    Two suggestions:

    1. Use the <AutoLoad Mode="IFrame"> option to sandbox the child page.

    2. Use XRender to dynamically load a UserControl on demand, see

    https://examples1.ext.net/#/XRender/...UpdateContent/

    Hope this helps.
    Last edited by Daniil; Feb 03, 2012 at 7:57 AM.
    Geoffrey McGill
    Founder
  3. #3
    Hi,

    I can suggest
    1. Set AutoRender="false" for the window. In this case, window and children widgets will be rendered after 'show' method calling only
    2. As Geoffrey mentioned, you can use XRender. Please see the following sample
    https://examples1.ext.net/#/Calendar/Overview/Basic/

    We render window from user control dynamically
    ((EventsViewer)this.Page.LoadControl("../Shared/Common/EventsViewer.ascx")).Render(events);

Similar Threads

  1. Replies: 10
    Last Post: Apr 25, 2013, 5:38 AM
  2. Replies: 3
    Last Post: Mar 19, 2012, 12:35 PM
  3. Replies: 1
    Last Post: Jan 27, 2012, 11:32 AM
  4. Replies: 4
    Last Post: Sep 17, 2010, 10:33 PM
  5. Faster solution to show data in a combobox.
    By sadeque in forum 1.x Help
    Replies: 1
    Last Post: Jul 30, 2009, 2:20 PM

Posting Permissions