[CLOSED] Dynamic window creation

  1. #1

    [CLOSED] Dynamic window creation



    I have a GridPanel which contains a list of hyperlinks.
    Each one points to a different URL.
    The hyperlinks are rendered using a custom gridRenderer:

    var myLinkRenderer = function (fundName,lang,fundCode,seriesName,currency,fa)
    { 
    // theBaseURL global variable is defined earlier
    var randomnumber=Math.floor(Math.random()*11111);
    var query = 'f=' + fundCode + '&s=' + seriesName + '&c=' + currency + '&lang=' + lang + '&r=' + randomnumber;
    if (fa != '') { query += '&fa=' + fa; }
    var url = '<a class="profile_link" href="launchWindow(\'' + theBaseURL + 'fundprofile.aspx?' + query + '\', \'' + fundName + '\');" alt="' + fundName + '" title="' + fundName + '">' + fundName + '</a>';
    return url; 
    }
    I want a function launchWindow that creates a new ext:Window and autoloads the IFrame with the url and sets the title. I don't want to have one window and reuse it by changing the url each time, I want the user to be able to have multiple windows open at the same time.

    In addition, is it possible to constrain those windows to the screen? The .constrainHeader attribute works for me only in FF, it creates havoc in IE.

  2. #2

    RE: [CLOSED] Dynamic window creation

    Hi Peter,

    The following script will create a new Window, adds it to the Page's body, sets the autoLoadIFrame property and then calls the .show() function to show the window.

    Example

    var win = new Ext.Window({
        renderTo: Ext.getBody(),
        title: "My Window",
        constrain: true,
        autoLoadIFrame: "http://www.google.com"
    });
    
    win.show();
    Setting the "constrain" property will ensure the Window can not be rendered/dragged outside the limits of browers viewport/window. See http://extjs.com/deploy/dev/docs/?cl...mber=constrain

    Hope this helps.

    Geoffrey McGill
    Founder
  3. #3

    RE: [CLOSED] Dynamic window creation



    I'd like to reopen this post if possible (or should I start a new post since this was marked solved?)...

    The AutoLoadIFrame doesn't seem to work anymore with the new window script (probably because of the change in the window to use the <AutoLoad> element).

    //open a page in a new tab
    function OpenWindow(winURL, winTitle, winHeight, winWidth) {
    if (winTitle == '' || winTitle == undefined) { winTitle = 'New Window' }
    if (winHeight == '' || winHeight == undefined) { winHeight = 400 }
    if (winHeight == '' || winWidth == undefined) { winWidth = 400 }
    var win = new Ext.Window({ renderTo: Ext.getBody()
      , maximizable: true
      , resizable: true
      , collapsible: true
      , constrain: true
      , title: winTitle
      , height: winHeight
      , width: winWidth
      , AutoLoadIFrame: winURL
    });
    win.show();
    };
  4. #4

    RE: [CLOSED] Dynamic window creation

    Hi,

    yes, AutoLoadIFrame is not accessable anymore. You should use autoload property in client-side


    var win = new Ext.Window({ renderTo: Ext.getBody()
    **, maximizable: true
    **, resizable: true
    **, collapsible: true
    **, constrain: true
    **, title: winTitle
    **, height: winHeight
    **, width: winWidth
    **, autoLoad:{
    * maskMsg:"My custom loading message...",
    * showMask:true,
    * mode:"iframe",
    * url:"http://www.ext.net"
    ** *}
    });


    On feathure, please start new topic, don't post to the solved topic


    Hope this help




  5. #5

    RE: [CLOSED] Dynamic window creation

    You Rock!!!

    Thanks so much for the quick reply, that works perfectly. Please mark as [CLOSED].

Similar Threads

  1. [CLOSED] Dynamic Panel Creation
    By state in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jul 21, 2009, 2:19 PM
  2. [CLOSED] Desktop dynamic window creation
    By llusetti in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: May 07, 2009, 6:16 AM
  3. Replies: 0
    Last Post: Apr 30, 2009, 12:55 PM
  4. Dynamic Portal Creation
    By iansriley in forum 1.x Legacy Premium Help
    Replies: 0
    Last Post: Jan 21, 2009, 5:53 PM
  5. Dynamic Creation Of Controls
    By Steve in forum 1.x Help
    Replies: 4
    Last Post: Dec 01, 2008, 5:46 PM

Posting Permissions