Completed
Last Updated: 18 Mar 2019 12:47 by ADMIN
CaseNet
Created on: 13 Mar 2019 08:03
Category: Editor
Type: Bug Report
0
M.enableContextMenus in not a function error on mobile with enableEditing(false)
We've a RadEditor controls, we want disable editting in mobile render mode. How can we do it?

Here examle:

Case 1. RadEditor is LightWeight:

<telerik:RadEditor ID="redEdt" runat="server"    RenderMode="LightWeight"     Width="100%" Height="500px" ></telerik:RadEditor>

<script>
                $(document).ready(function () {
                    var editor = $telerik.findControl(document.documentElement, "redEdt");
                    editor.enableEditing(false);
                })

</script>   

--> It work great. All buttons in toolbar disabled.

Case 2. RadEditor is Mobile:

<telerik:RadEditor ID="redEdt" runat="server"    RenderMode="Mobile"     Width="100%" Height="500px" ></telerik:RadEditor>

<script>
                $(document).ready(function () {
                    var editor = $telerik.findControl(document.documentElement, "redEdt");
                    editor.enableEditing(false);
                })

</script> 

--> System error: 

M.enableContextMenus is not a function
    at c.RadEditor.enableEditing
2 comments
ADMIN
Rumen
Posted on: 18 Mar 2019 12:47
I am following-up with good news that the fix was incorporated in the new Latest Internal Build (Telerik_UI_for_ASP.NET_AJAX_2019_1_318_Dev_hotfix.zip) which you can download from your account https://www.telerik.com/account/product-download?product=RCAJAX  -> Internal Builds as shown in the attached screenshot.

The release notes are:
  • onParentNodeChanged() causes an Cannot read property 'defaultView' of undefined error in Chrome 73
  • M.enableContextMenus in not a function error on mobile with enableEditing(false)
Best regards,
Rumen
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Attached Files:
ADMIN
Rumen
Posted on: 13 Mar 2019 08:16
Hello CaseNet,

Thank you for reporting this problem!

I verified it and fixed it in the source code so that it can appear in the next LIB (release date TBD) and official R2 2019 release (due in beginning of May 2019).

You can solve the M.enableContextMenus is not a function error in your existing version of RadEditor via the highlighted code:

<script>
    Telerik.Web.UI.Editor.MobileToolAdapter.prototype.enableContextMenus = function() { }
</script>
<telerik:RadEditor ID="redEdt" runat="server" RenderMode="Mobile" Width="100%" Height="500px"></telerik:RadEditor>

Please add the solution to your project, test it and let me know how it works.

<%@ Page Language="C#"  %>
 
<!DOCTYPE html>
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager id="das" runat="server"></asp:ScriptManager>
        <div>
        <script>
            Telerik.Web.UI.Editor.MobileToolAdapter.prototype.enableContextMenus = function() { }
        </script>
        <telerik:RadEditor ID="redEdt" runat="server" RenderMode="Mobile" Width="100%" Height="500px"></telerik:RadEditor>
        </div>
 
            <script>
                $telerik.$(document).ready(function () {
                    var editor = $telerik.findControl(document.documentElement, "redEdt");
                    editor.enableEditing(false);
                })
 
            </script>
    </form>
</body>
</html>


You were also rewarded with Telerik points for reporting this issue.

Best regards,
Rumen
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.