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

Client-Side RadWindow Creation

4 Answers 142 Views
Window
This is a migrated thread and some comments may be shown as answers.
Clifton Brown
Top achievements
Rank 1
Clifton Brown asked on 23 Nov 2010, 06:27 PM
hello, is there a way for me to create RadWindows dynamically on the client side?

Here is my situation: I have a page that has several links that when clicked needs to open a RadWindow. each link opens a different window. What I do now is create the windows on Page Load and then add the "onclick" javascript attribute to the link's. Therefore, even if the links are never clicked by the user the windows are still being created.

I want to use client-side because I don't want to trigger a postback by creating the windows in code-behind via a button. Now my javascript will take as parameter the URL of the window to open and other properties such as window dimensions. The clien-side script will then create the RadWindow and open it. The page has a window manager but I do not want to create the windows statically inside the window manager because I may not know ahead of time how many windows I need.

Also, the window manager is created in the master page that I use to style all my pop-up windows, that's why i cant define windows statically because that master page is used for many different pop-up windows. Finally I would like the window that is created on client-side to inherit the standard properties i have set on the Window manager in the master page.

Can this be done?

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 24 Nov 2010, 12:23 PM
Hello,


There are several functions that let you open a RadWindow object from your client-side javascript: Check the following documentation on how to do it.
Opening Windows


-Shinu.
0
Svetlina Anati
Telerik team
answered on 24 Nov 2010, 03:01 PM
Hi Clifton,

 The radopen method does exactly what you need and also the best place for the RadWindowManager is the MasterPage as you have done. What you should do now is to set the desired common properties to the RadWindowManager and then open RadWindows with radopen(url, null) - this will create a new RadWindow dynamically on the client. If you want also to destroy the created client object for the RadWindow when it is closed you can also add DestroyOnClose="true" in the RadWindowManager declaration.


All the best,

Svetlina
the Telerik team

 

Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Clifton Brown
Top achievements
Rank 1
answered on 24 Nov 2010, 03:48 PM
My thanks to both Shinu & Admin... just what I was looking for :-)
0
Dhamodharan
Top achievements
Rank 1
answered on 01 Dec 2014, 02:13 PM
Can you send the sample code please?


Thanks in Advance,
Dhamu
Tags
Window
Asked by
Clifton Brown
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Svetlina Anati
Telerik team
Clifton Brown
Top achievements
Rank 1
Dhamodharan
Top achievements
Rank 1
Share this question
or