Using the RadWindow clientside API

Article Info

Rating: 5

Article information

Article relates to

all versions of RadWindow

Created by

Georgi, Telerik

Last modified

April 04, 2008

Last modified by

Svetlina, Telerik


HOW-TO
Use the RadWindow object's client-side API






SOLUTION 
Here is a list of the client-side RadWindow methods
  • SetSize - sets size (width and height) of window
  • MoveTo - sets position (top, left) of window
  • Minimize - minimizes window
  • Maximize - maximizes window
  • Restore - restores window
  • SetUrl - changes URL of window
  • Reload - reloads page in window (page should come from the same server as is the parent page
  • Close - closes window
  • SetModal - sets modality of window
  • SetContent - allows dynamic content to be set to the window (rather than loading a url)
  • SetWidth - sets window width
  • SetHeight - sets window height
  • GetWidth - gets window width
  • GetHeight - gets window height
  • SetTitle - sets window title

Sample usage of the client-side RadWindow methods:

function UseRadWindow()

    
var oManager = GetRadWindowManager(); 
    
var oWnd = oManager.GetWindowByName("DialogWindow");
    oWnd.Show();
    oWnd.SetSize(400,400); 
    oWnd.SetUrl("http://www.yahoo.com"); 
    oWnd.Minimize();
    oWnd.Maximize();
    oWnd.Restore();





The manner of usage of the client-side API of RadWindow for ASP.NET AJAX (Prometheus) is the same - you should first obtain a reference to the particular object and then you are able to use its methods. RadWindow for ASP.NET AJAX (Prometheus), however, has different client - side API than the Classic RadWindow. Below is a list of methods, analogous to the above one:


  • setSize - sets size (width and height) of window
  • moveTo - sets position (top, left) of window
  • minimize - minimizes window
  • maximize - maximizes window
  • restore - restores window
  • setUrl - changes URL of window
  • reload - reloads page in window (page should come from the same server as is the parent page
  • close - closes window
  • set_Modal - sets modality of window
  • set_Width - sets window width
  • set_Height - sets window height
  • get_Width - gets window width
  • get_Height - gets window height
  • set_Title - sets window title

Sample usage of the client-side RadWindow's methods:

function UseRadWindow()

    
var oManager = GetRadWindowManager(); 
    
var oWnd = oManager.getWindowByName("DialogWindow");
    oWnd.show();
    oWnd.setSize(400,400); 
    oWnd.setUrl("http://www.yahoo.com"); 
    oWnd.minimize();
    oWnd.maximize();
    oWnd.restore();

Another significant difference between the RadWindow controls from the two suites is that you can use RadWindow for ASP.NET AJAX (Prometheus) as a separate control, without having a RadWindowManager on the page. In this case you can obtain a reference to the RadWindow object by using the AJAX method $find as shown below:


var oWnd = $find("<%=SingleWnd.ClientID%>");
oWnd.show();

You can find a demo project which shows the above explained methods and approaches in the attached RadWindowClientside_Prometheus.zip archive file.

Comments

If you'd like to comment on this KB article, please, send us a Support Ticket.
Thank you!

Please Sign In to rate this article.