Open Editor dialog relative to browser

1 Answer 114 Views
Editor
Dave
Top achievements
Rank 1
Iron
Veteran
Iron
Dave asked on 18 Aug 2021, 11:21 PM

Hi,

I have a modal RadWindow, whose content page contains a RadEditor.   When an editor dialog is opened, it's position and movement is limited to the content area of the RadWindow.  Is there a way to have the editor dialogs open modal, but relative to the browser?  Thus allowing the editor dialog to be positioned overlapping or even outside of the RadWindow.

Thanks,

Dave

 

1 Answer, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 19 Aug 2021, 02:29 PM

Hello Dave,

The content page loaded in RadWindow is rendered inside an <iframe>, so it has different context than the current page. This is why the dialogs of the Editor can be dragged only in the context of their parent window (and, respectively - parent iframe).

You can switch to the default browser pop-up windows, though, by following the approach from this KB article:

https://www.telerik.com/support/kb/aspnet-ajax/details/using-browser-modal-dialog-instead-of-radwindow

        <script type="text/javascript">  
            function OnClientLoad(editor) {
                editor.set_useClassicDialogs(true);
            }
        </script>
        <telerik:RadEditor ID="RadEditor1" OnClientLoad="OnClientLoad" runat="server"></telerik:RadEditor>
    

Regards,
Vessy
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Dave
Top achievements
Rank 1
Iron
Veteran
Iron
commented on 20 Aug 2021, 02:28 AM

HI Vessy,

Thanks for your suggestion, but I'd rather keep the look and feel consistent by using modal RadWindows throughout the app.  I found this thread from long ago:  https://www.telerik.com/forums/radeditor-in-radwindow-open-dialogues-in-a-different-radwindow.  The Accepted answer by Dobromir provides some code that uses the Editor's dialogOpener to cause the dialogs to open outside of the RadWindow housing the Editor, and relative to BrowserWindow.

I was able to incorporate this solution in our app and it appears to be behaving as we want.  Unless you see something in this solution from 2010 that hasn't aged well....

Thanks!

Dave


 

Vessy
Telerik team
commented on 24 Aug 2021, 04:55 PM

Hi Dave,

I tested the approach suggested by Dobromir both with classic and Lightweight rendering. It behaves properly at my end with the latest version of the control, so you can keep using it if the result behavior suits your needs :)

Dave
Top achievements
Rank 1
Iron
Veteran
Iron
commented on 24 Aug 2021, 06:45 PM

Thank you Vessy for confirming the validity!

Much appreciated!

Dave

 

Vessy
Telerik team
commented on 25 Aug 2021, 03:05 PM

You are welcome, Dave!
Tags
Editor
Asked by
Dave
Top achievements
Rank 1
Iron
Veteran
Iron
Answers by
Vessy
Telerik team
Share this question
or