FYI javascript errors when ToolbarMode and ToolProviderID both set

3 posts, 1 answers
  1. Yeroon
    Yeroon avatar
    87 posts
    Member since:
    Oct 2012

    Posted 10 Jan 2012 Link to this post

    Hello,

    I experienced all kinds of javascript errors after configuring 2 RadEditors on an Aspx page where in the 2nd one the ToolProviderID was set (to the first) and also the ToolbarMode property was set.

    First Error (more errors after that, but related to this) in

    File:  RadRibbonBarScripts.js
    Line: this._groupContainer.css("visibility","hidden");
    Error: Microsoft JScript runtime error: Object doesn't support property or method 'css'

    Aspx error causing markup:
    <telerik:RadEditor ID="RadEditor2" runat="server" ToolbarMode="RibbonBar" ToolsFile="Tools.xml"
        Width="98%" Height="300" OnClientLoad="ResizeEditor" Language="nl-NL" AutoResizeHeight="False"
        OnClientModeChange="editorModeChanged" LocalizationPath="~/Resources/" ExternalDialogsPath="~/Resources/EditorDialogs/">
        <FontNames>
            <telerik:EditorFont runat="server" Value="Verdana" />
        </FontNames>
        <SpellCheckSettings AllowAddCustom="True" DictionaryLanguage="nl-NL"></SpellCheckSettings>
        <MediaManager UploadPaths="~/Media/" ViewPaths="~/Media/" DeletePaths="~/Media/"
            MaxUploadFileSize="10240000"></MediaManager>
        <ImageManager UploadPaths="~/Media/" ViewPaths="~/Media/" DeletePaths="~/Media/"
            EnableImageEditor="False" MaxUploadFileSize="10240000" EnableThumbnailLinking="True">
        </ImageManager>
        <DocumentManager ViewPaths="~/Documents/" UploadPaths="~/Documents/" DeletePaths="~/Documents/" />
    </telerik:RadEditor>
     
    <telerik:RadEditor ID="RadEditor1" runat="server" ToolbarMode="RibbonBar" ToolProviderID="RadEditor2"
        Width="98%" Height="500" OnClientLoad="ResizeEditor" Language="nl-NL" AutoResizeHeight="False"
        OnClientModeChange="editorModeChanged" LocalizationPath="~/Resources/" ExternalDialogsPath="~/Resources/EditorDialogs/">
        <FontNames>
            <telerik:EditorFont runat="server" Value="Verdana" />
        </FontNames>
        <SpellCheckSettings AllowAddCustom="True" DictionaryLanguage="nl-NL"></SpellCheckSettings>
        <MediaManager UploadPaths="~/Media/" ViewPaths="~/Media/" DeletePaths="~/Media/"
            MaxUploadFileSize="10240000"></MediaManager>
        <ImageManager UploadPaths="~/Media/" ViewPaths="~/Media/" DeletePaths="~/Media/"
            EnableImageEditor="False" MaxUploadFileSize="10240000" EnableThumbnailLinking="True">
        </ImageManager>
        <DocumentManager ViewPaths="~/Documents/" UploadPaths="~/Documents/" DeletePaths="~/Documents/" />
    </telerik:RadEditor>

    After you remove ToolBarMode="RibbonBar" from the second RadEditor, everything works again.
    With regards,

    Edit: Using 2011.3.1305.40

    Yeroon
  2. Yeroon
    Yeroon avatar
    87 posts
    Member since:
    Oct 2012

    Posted 10 Jan 2012 Link to this post

    PS the above works as in no more Javascript errors. The 2nd editor wont work though. Can't put cursor in it and toolbar won't show. Only after switching to Html Mode and back to design, you can enter text again. Contect menu's and toolbar still don't show though.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Answer
    Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 11 Jan 2012 Link to this post

    Hi Yeroon,

    The combination of ToolsProviderID and ToolbarMode for RadEditor is not supported scenario. The problem comes from the fact that when ToolsProviderID is used the toolbar used for the provider editor is cloned and is used by the consumer editor. But, the RibbonBar is a server control and it cannot be simply cloned on the client, it must be created as a separate control, where the purpose of ToolsProviderID is to avoid this.

    Regards,
    Dobromir
    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