[CLOSED] Create multiple windows..

  1. #1

    [CLOSED] Create multiple windows..

    Hi,

    I want to be able to create multiple windows on my web app - if you right click on a tree node and choose "details" I want to open up the details window for that node. If you then do the same for another node it needs to open up without replacing the current one.

    Currently I have a window defined in my page like this:

        <ext:Window 
        ID="RackViewWindow" runat="server" Icon="ApplicationFormEdit" Width="350" Height="500" 
        Title="Rack View" Hidden="true"  Modal="false">
        <AutoLoad 
            Url="/Rack/id/" 
            Mode="IFrame"
            TriggerEvent="show" 
            ReloadOnEvent="true" NoCache="true">
            <Params>
                <ext:Parameter Name="id" Value="" Mode="Value" />
            </Params>
        </AutoLoad>
        <Listeners>
            <Hide Handler="" />
        </Listeners>
        </ext:Window>
    Is it possible to open multiple instances of this window, or do I need to create an "Ext.Window" in javascript for each node?


    -- EDIT --

    When I tried the JS route to see if it would work, it doeesn't render my page inside the window. I can see the page request to the server, but the response is never rendered inside this window.. I tried substituting with a simple "test.htm" page, and that does render inside the window...

    Js looks like this:

            toolwindow = new Ext.Window({
                modal: false,                
                maximizable: true, 
                minimizable:true,               
                title: TreePanel1.menuNode.text, 
                resizable: true,
                autoLoad:{url:'/Rack/' + TreePanel1.menuNode.id.substr(4)},
                width:350,                
                height:500
                ,listeners:{show:function() {
                    this.loadMask = new Ext.LoadMask(this.body, {
                        msg:'Loading. Please wait...'
                    });
                  }}               
                });
    
            toolwindow.show();
    Thanks
    Last edited by Daniil; Mar 11, 2011 at 11:50 AM. Reason: [CLOSED]
  2. #2
    Hi,

    No, you can't create multiple instances of defined in the markup Window.

    So, your way to create it in JavaScript is correct.

    You just missed some required config options to get it working, like
    mode : "iframe"
    Please use the .autoLoad like the following one:

    Example
    new Ext.Window({
        autoLoad: {
            url : "Test.aspx",
            showMask : true,        
            mode : "iframe",
            params : {
                id : "someId"
            },
        },
        hidden: false
    });
    Also you could replace 'show' listener and calling .show() with
    hidden : false
  3. #3
    Thanks - that solved it for me :) It also solved a related problem where the vertical scroll bar wasn't allowing me to scroll to the entire height of the contained page.
  4. #4
    Glad to help.

    Always when you need to create a widget dynamically (any widget: Window, ComboBox, etc) you could create it in the markup, then see page sources (View sources in IE) to get the generated by that markup script. Then you can use this script.
  5. #5
    Hi,

    You can always create window in the codebehind, set unique ID and render it.
    Please see the following sample (double click on event to open details window)
    https://examples1.ext.net/#/Combinat.../Simple_Tasks/

    Also you can place the window inside user control and render it (Save all events button)
    https://examples1.ext.net/#/Calendar/Overview/Basic/

Similar Threads

  1. [CLOSED] Multiple Panels in Windows w/ scrolling
    By cwolcott in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: Jul 27, 2012, 3:13 PM
  2. Replies: 0
    Last Post: Jun 10, 2012, 5:41 AM
  3. Right Way of creating multiple windows.
    By Mauricio Rojas in forum 1.x Help
    Replies: 1
    Last Post: Feb 22, 2012, 8:33 PM
  4. [EXAMPLE] How to create new windows
    By snippher in forum Examples and Extras
    Replies: 18
    Last Post: May 21, 2010, 10:03 AM
  5. Replies: 2
    Last Post: Jun 19, 2009, 2:49 PM

Posting Permissions