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

FYI javascript errors when ToolbarMode and ToolProviderID both set

2 Answers 59 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Yeroon
Top achievements
Rank 2
Yeroon asked on 10 Jan 2012, 11:47 AM
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 Answers, 1 is accepted

Sort by
0
Yeroon
Top achievements
Rank 2
answered on 10 Jan 2012, 11:58 AM
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.
0
Accepted
Dobromir
Telerik team
answered on 11 Jan 2012, 01:36 PM
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
Tags
Editor
Asked by
Yeroon
Top achievements
Rank 2
Answers by
Yeroon
Top achievements
Rank 2
Dobromir
Telerik team
Share this question
or