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

[Solved] Pre-set all properties prior to show?

6 Answers 126 Views
Window
This is a migrated thread and some comments may be shown as answers.
Stephane Zanoni
Top achievements
Rank 1
Stephane Zanoni asked on 16 Apr 2008, 09:26 PM
Using the window.radopen() to return the window object and having it display is very limiting.

The problem is setting the size, status, title and all the options after the window has already been displayed.

Is there a way to get the object back in a hidden state, so the window can be initialized properly before displaying.  Nothing in the docs seem to suggest this is possible.

Thanks.

6 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 17 Apr 2008, 01:51 PM
Hi Stephane,

You can use the ASP.NET AJAX $find() method to get a reference to the RadWindow on your page. This way you can call its client-side methods (setSize(), setStatus(), etc.) and after that - its show() method.



Kind regards,
Georgi Tunev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Stephane Zanoni
Top achievements
Rank 1
answered on 17 Apr 2008, 02:05 PM
Unfortunately, I don't have pre-created windows laying around to use, all the windows are dynamically created when the users interacts with the environment.

Also, we have an unlimited number of windows that could be open so pre-creating 1 window and re-using it does not work.
0
Stephane Zanoni
Top achievements
Rank 1
answered on 20 Apr 2008, 02:10 AM
Any ideas??
0
Lini
Telerik team
answered on 22 Apr 2008, 07:50 AM
Hello,

The RadWindow client object has a .clone() method. This means that you can create only one window, clone it a number of times and then set its properties on the client. After that, you can use the .show() method of the RadWindow client object to show the newly cloned window.

Kind regards,
Lini
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Stephane Zanoni
Top achievements
Rank 1
answered on 22 Apr 2008, 02:22 PM
That sounds good... I checked the demo and documentation, but I can't seem to find the javascript docs for the Window object.

Can you point me to it?
0
Lini
Telerik team
answered on 24 Apr 2008, 02:44 PM
Hello,

This is odd. Perhaps the property has not yet been added to the docs. Here is how you should use it:

First you need to have a base window in the RadWindowManager's collection. If you are not using a RadWindowManager control, I think that you only need the window control:

<telerik:RadWindowManager id="RadWindowManager1" runat="Server">  
<Windows> 
    <telerik:RadWindow id="RadWindowBase" runat="server"></telerik:RadWindow> 
</Windows> 
</telerik:RadWindowManager> 


Next you can use the following JS code to open new windows:
function openNewWindow(name, url)  
{  
    var baseWindow = $find("<%= RadWindowBase.ClientID %>");  
    var newWindow = $find(name);  
    if (null != newWindow)  
    {  
        //dispose old window;  
        newWindow.dispose();  
    }  
    newWindow = baseWindow.clone(name);  
    //set properties here  
    newWindow.set_navigateUrl(url);  
    //show the new window  
    newWindow.show();  

For example:
openNewWindow("googleWindow", "http://www.google.com/");

The name parameter is what you can use to reference your window in the future and the url parameter is the window's navigateUrl property.

Greetings,
Lini
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Window
Asked by
Stephane Zanoni
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Stephane Zanoni
Top achievements
Rank 1
Lini
Telerik team
Share this question
or