Show default IE Context Menus

7 posts, 1 answers
  1. Michael
    Michael avatar
    12 posts
    Member since:
    Aug 2012

    Posted 27 Jul 2012 Link to this post

    Hi,

    Is there any way to show the default IE context menu when the user right clicks in the editor? I don't want a custom context menu, just the default context menu. The client has a rather rich IE context menu with customizations from add-ons and in the radeditor the menu is not shown. I have tried disabling the editor context menus but still nothing shows.

    Thank you.

    Michael
  2. Answer
    Rumen
    Admin
    Rumen avatar
    12846 posts

    Posted 31 Jul 2012 Link to this post

    Hi,

    If you want to enable the default browser's content menu and disable the built-in context menus of RadEditor, you can do that using the following JavaScript code:

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


    Regards,
    Rumen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Michael
    Michael avatar
    12 posts
    Member since:
    Aug 2012

    Posted 31 Jul 2012 Link to this post

    Hi Rumen,

    That works greatly in showing the default IE context menu. However it also removes the customizations the client has on those menus and shows simply the classic menus. Any thoughts on how to fix that?

    Regards,
    Michael
  5. Rumen
    Admin
    Rumen avatar
    12846 posts

    Posted 01 Aug 2012 Link to this post

    Hi,

    Could you please be more specific and provide screenshot or video demonstrating the customized context menus of your client? The code just disables the RadEditor's context menus and does not alter the browser's ones.

    All the best,
    Rumen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  6. Michael
    Michael avatar
    12 posts
    Member since:
    Aug 2012

    Posted 01 Aug 2012 Link to this post

    Hi Rumen,

    I have been able to resolve it with a combination of your script and setting the editor content area mode to Div. It seems to not work with i-frames I suppose the custom menus recognize the area differently.

    Thank you for your help.

    Regards,

    Michael
  7. Hareesh
    Hareesh avatar
    1 posts
    Member since:
    Feb 2013

    Posted 22 Feb 2013 Link to this post

    Hi Rumen,

    In RadEditor i have created a context menu 
    --------------------------------------------------------------
    <ContextMenus>
                                     <Telerik:EditorContextMenu  Enabled="True" TagName="P" >
                                             <Telerik:EditorTool Text="Compare" Name="comapre" ShowIcon="true" ImageUrl="../Images/Compare.ico" />
                                      </Telerik:EditorContextMenu>
       </ContextMenus>
    ------------------------------------------------------------------------------
    calling that context menu item from java script-------in this i am calling serverside button click
      function OnClientCommandExecuting(commandName, editor, args) 
            {
                Telerik.Web.UI.Editor.CommandList["comapre"] = function (commandName, editor, args) {
                    //var editor = $find("<%=RadEditor1.ClientID%>");
                    var selection = editor.getSelectionHtml();
                    var elem = editor.getSelectedElement();
                    if (elem.tagName == "P") {
                        document.getElementById("hf1").value = selection;
                        var clickButton = document.getElementById("<%= btnCompare.ClientID %>");
                        clickButton.click();
                         
                    }
                };

            }
    All this is working fine in fire fox and chrome,but when comes to IE it is showing context menu for right click,next time right clicks default context menu is displaying ,i need to display custom context menu................. 
  8. Rumen
    Admin
    Rumen avatar
    12846 posts

    Posted 26 Feb 2013 Link to this post

    Hi,

    I was unable to reproduce the reported issue using the provided code. You can see how it works at my end in this video: http://screencast.com/t/ELmB9IC3XVc.

    Greetings,
    Rumen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017