set windows behavior by JavaScript

4 posts, 0 answers
  1. Shahid
    Shahid avatar
    12 posts
    Member since:
    May 2009

    Posted 18 Nov 2009 Link to this post

    function openRadWindow(wndTitle, sParentID)
    {
    var oWnd = parent.window.radopen('Default.aspx?ID=' + sParentID + '&Title=' + wndTitle, null);
    oWnd.set_behaviors(Telerik.Web.UI.WindowBehaviors.Reload + Telerik.Web.UI.WindowBehaviors.Close);
    oWnd.SetSize(360, 400);
    oWnd.MoveTo(300, 90);
    return false; 
    }

    I am using the above javascript code for opening and setting the behaviour of radwindow.
    I am able to get the object of Telerik.Web.UI although Telerik.Web.UI.WindowBehaviors comes out to be undefined. I have registered the Teleric.Web.UI dll in my application and is able to use successfully the other radControls.


  2. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 18 Nov 2009 Link to this post

    Hi Shahid,

    I believe that this forum thread will be of help:
    http://www.telerik.com/community/forums/aspnet-ajax/window/set-behaviors-client-side.aspx



    Kind regards,
    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Shahid
    Shahid avatar
    12 posts
    Member since:
    May 2009

    Posted 19 Nov 2009 Link to this post

    Thanks Georgi,

    The Link you provided solved my above query.
    I have one more question, I want to capture the OnWindowClose event on 'Default.aspx page' (The one I used in my above code). Can I do that.?
    I am opening a radwindow from a parent page, and would like to get an alert through javascript function present on Default.aspx page when a user clicks on the Close button 'Cross' on the right corner of the radwindow.

    Cureently I am able to capture the window close event on the parent page, becuase WindowManager is present there. Is there a way to capture this event on the page which is inside radwindow..?
  4. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 19 Nov 2009 Link to this post

    Hello Shahid,

    There is an OnBeforeClose event handler (add_beforeClose() / remove_beforeClose() client-side methods) that could be used for such purpose. Note that to avoid problems with the script execution, this function should be handled on the parent page, where the RadWindowManager is.


    Sincerely yours,
    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top