This is a migrated thread and some comments may be shown as answers.

[Solved] Unique Window pattern

0 Answers 111 Views
Window
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
nachid
Top achievements
Rank 1
nachid asked on 07 Sep 2010, 12:50 PM
for performance reasons, I decided to have a unique window for all my application
I am loading this unique window in my master page
And whenever, I need to display a window, I just call this unique window through a function passing it a new title, a new content or a new url
I am very happy with this pattern and it is working with a minor issue and I hope having help here to get around it
First of all, here is the code I am using and hope this can help others

 function  openMyUniqueWindow (options)
  {
        var myWindow = $("#ModalWindow").data("tWindow");

        myWindow.title(options.title);

        if (options.htmlContent !== undefined)
        {
            myWindow.content(options.htmlContent);
        }
        else (options.contentPath !== undefined)
        {
            myWindow.ajaxRequest(options.contentPath);
        }
        myWindow.center().open();
    }


The issue is the size of the new window.
Height and width are normally setup, once for all, at the server side, when the window is generated
When a new content is loaded, they are not updated.
I am wondering what would be the best approch for having a new dimensions for my new content

Any hint?
thank you
Tags
Window
Asked by
nachid
Top achievements
Rank 1
Share this question
or