How to check if I am in RadWindow now

3 posts, 1 answers
  1. Alex
    Alex avatar
    4 posts
    Member since:
    Aug 2010

    Posted 13 Dec 2010 Link to this post

    I have written a component which is used in several places. It can be used as usual (simply at a page) and in RadWindow. It contains some jscript code which must determine if this component is in RadWindow or not. How can it be done? Thanks in advance.
  2. Answer
    Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 13 Dec 2010 Link to this post

    Hello Alex,

    You could use a slightly modified version of the GetRadWindow() function for this case:

    function GetRadWindow()
      {
          var oWindow = null;
          if (window.radWindow) oWindow = window.radWindow;
          else if (window.frameElement && window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
          return oWindow;
      }
     
      function CheckWnd()
      {
          var wnd = GetRadWindow();
          if (wnd)
          {
              alert("This page is loaded in a RadWindow");
          }
          else
          {
              alert("The page is loaded in the browser");
          }
      }


    Regards,
    Georgi Tunev
    the Telerik team
    Browse the vast support resources we have to jump start 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.
  3. Alex
    Alex avatar
    4 posts
    Member since:
    Aug 2010

    Posted 13 Dec 2010 Link to this post

    Thank you very much. It works.
Back to Top