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

Radeditor in Radwindow, open dialogues in a different radwindow

5 Answers 182 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Darren
Top achievements
Rank 1
Darren asked on 22 Feb 2010, 10:29 PM
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.

5 Answers, 1 is accepted

Sort by
0
Dobromir
Telerik team
answered on 25 Feb 2010, 06:57 AM
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.
0
Darren
Top achievements
Rank 1
answered on 27 Feb 2010, 01:11 AM
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
0
Accepted
Dobromir
Telerik team
answered on 01 Mar 2010, 04:47 PM
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.
0
Darren
Top achievements
Rank 1
answered on 01 Mar 2010, 11:51 PM
Dobromir,

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

Thank You,
Darren
0
Waseem
Top achievements
Rank 1
answered on 28 Jun 2012, 01:18 AM
USE THIS URL FOR Resizing your Radwindow of RadEditor

http://www.telerik.com/support/kb/aspnet-ajax/editor/setting-dialog-pop-up-position.aspx
Tags
Editor
Asked by
Darren
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
Darren
Top achievements
Rank 1
Waseem
Top achievements
Rank 1
Share this question
or