Radeditor in Radwindow, open dialogues in a different radwindow

6 posts, 1 answers
  1. Darren
    Darren avatar
    16 posts
    Member since:
    Jun 2009

    Posted 22 Feb 2010 Link to this post

    I currently have a radeditor inside of a radwindow. The radwindow pops up when a user clicks on something and then they can edit the content in the new window. I am experiencing problems with the resizing of the radwindow when opening a dialogue. The initial dialog expands the radwindow sufficiently so I can view it (see screenshot "2_hyperlink_manager.jpg"). However, when I open the document manager from within the hyperlink manager, the document manager does not resize the original radwindow again so I cannot see the entire dialog (see screenshot "3_dialog_window.jpg"). Because of this and some other issues, I would like to change how dialogs open when clicked on from the radeditor. I think that opening the dialog windows outside of the calling radwindow that contains the editor would be more the effect I am looking for. This is what I cannot figure out how to do.

    Can you please either redirect me to instructions or provide assistance for how to accomplish this? Or even put the radeditor into another control (not sure which one) that could behave like a popup window so that the dialogs open in a new radwindow on their own. I really like the "modal" features in the radwindow though.

    Thank you kindly for your assistance.
  2. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 25 Feb 2010 Link to this post

    Hi Darren,

    RadEditor does not provide such functionality out-of-the box. As a solution I would suggest you a couple of approaches:
    1. Resize the RadWindow that contains the editor, e.g.:
      <telerik:RadEditor ID="RadEditor" runat="server" OnClientCommandExecuted="OnClientCommandExecuted">
      </telerik:RadEditor>
      <script type="text/javascript">
          //Get reference to parent RadWindow object
          function GetRadWindow()
          {
              var oWindow = null;
              if (window.radWindow) oWindow = window.radWindow;
              else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
              return oWindow;
          }
       
          //When opening a dialog
          function OnClientCommandExecuted()
          {
              //Get e reference to the dialog and move it to top left of the page
              var wnd = Telerik.Web.UI.RadWindowController.get_activeWindow();
              wnd.moveTo(0, 0);
       
              //Get reference to parent RadWindow
              var parentWnd = GetRadWindow();
       
              //Save its current bounds
              var bounds = parentWnd.getWindowBounds();
       
              //Auto size the parent
              parentWnd.autoSize();
       
              //When closing the dialog
              var handler = function(sender, args)
              {
                  //Restore old size
                  parentWnd.setBounds(bounds);
                  //Remove the close handler
                  wnd.remove_close(handler);
              }
              wnd.add_close(handler);
          }       
      </script>
    2. Set the editor to use default browser popups for its dialogs. This can be done with the following code:
      <telerik:RadEditor ID="RadEditor1" runat="server" OnClientLoad="OnClientLoad">
      </telerik:RadEditor>
      <script type="text/javascript">
          function OnClientLoad(editor, args)
          {
              editor.set_useClassicDialogs(true);
          }
      </script>

    Best wishes,
    Dobromir
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Darren
    Darren avatar
    16 posts
    Member since:
    Jun 2009

    Posted 26 Feb 2010 Link to this post

    Dobromir,

    Thank you for your response.

    First, would the "classic" dialogs open via javascript and therefore be subject to blocking by pop-up blockers?

    Second, I am assuming that when you open the editor in a radwindow, that the dialogs open inside of that radwindow. Is there another control that you would recommend to act as a popup to contain the radeditor so that the dialogs popup in their own window?

    Having the dialogs popup outside of the radeditor, like it does if I had the radeditor directly on the page, still seems like the cleanest implementation.

    Thank You,
    Darren
  5. Answer
    Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 01 Mar 2010 Link to this post

    Hi Darren,

    I came up with another possible solution for this problem and I believe this should match the desired outcome - open RadEditor's dialogs in a window that resides on the same page as the RadWindow control that contains the editor. I have attached a sample project implementing this approach.

    Now regarding your questions:

    Yes, "classic" dialogs will be detected as pop-ups and will be blocked because they are standard browser windows.

    And again, yes that is exactly how it works:
    • RadWindow is an IFRAME which content is a completely different document.
    • If you have RadEditor inside RadWindow, RadEditor's dialogs are elements of RadWindow's document. 
    As for a similar to RadWindow control, we have RadDock and RadTooltip which are used for different purpose and I do not think that they are suitable for your scenario.

    Best wishes,
    Dobromir
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  6. Darren
    Darren avatar
    16 posts
    Member since:
    Jun 2009

    Posted 01 Mar 2010 Link to this post

    Dobromir,

    Thank you very much for your response and solution. This is exactly what I was looking for.

    Thank You,
    Darren
  7. <span>w</span>
    <span>w</span> avatar
    84 posts
    Member since:
    Jun 2012

    Posted 27 Jun 2012 Link to this post

    USE THIS URL FOR Resizing your Radwindow of RadEditor

    http://www.telerik.com/support/kb/aspnet-ajax/editor/setting-dialog-pop-up-position.aspx
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017