Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Getting StartedGetting StartedUsing the Telerik editor controlUsing the Telerik editor control
Previous
 
Next
New Post
4/10/2014 7:02 PM
 
that message just means that the object captured in the editor reference does not have that method -in other words you still aren't selecting the right object (sorry I cant offer better advice I haven't played with telerik editors clientside capabilities much)

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
4/11/2014 8:26 AM
 

Thank you for your reply.

I was wondering if it's possible that I'm selecting the correct object but that the associated javascript wasn't registered.

ClientResourceManager.RegisterScript(this.Page, this.ControlPath + "?????.js");

So I searched all files in the DNN directories for 'function get_html', which wasn't found.

So does anyone know where the get_html function for the editor control comes from?

I can see that the web.config references the editor:

    <htmlEditor defaultProvider="DotNetNuke.RadEditorProvider">

      <providers>

        <clear />

        <add name="DotNetNuke.RadEditorProvider" type="DotNetNuke.Providers.RadEditorProvider.EditorProvider, DotNetNuke.RadEditorProvider" providerPath="~/DesktopModules/Admin/RadEditorProvider" />

      </providers>

    </htmlEditor>

And that the directory ~/DesktopModules/Admin/RadEditorProvider contains the editor related files.

But if that function doesn't exist in any file it's difficult to imagine how it can work.

Best Regards,

Steve

           

 

 
New Post
4/11/2014 10:03 AM
 

Hello,

Please see below the html captured from the following lines:

var editor = $("#<%=WysiwygDescription.ClientID%>");

var oSelElem = editor.get_html();

Towards the bottom it says:

RadEditor - please enable JavaScript to use the rich text editor.

So the question is how? Tried following the suggestion here:

http://www.telerik.com/forums/radedit...

Didn't make any difference.

Anyone got any ideas?

Steve

<!-- 2013.2.717.40 --><div id="dnn_ctr509_Edit_MainFormUserControl_ContentItemUserControl_WysiwygDescription_dialogOpener" style="display: none;">

<div id="dnn_ctr509_Edit_MainFormUserControl_ContentItemUserControl_WysiwygDescription_dialogOpener_Window" style="display: none;">

<div id="dnn_ctr509_Edit_MainFormUserControl_ContentItemUserControl_WysiwygDescription_dialogOpener_Window_C" style="display: none;">

</div><input name="dnn_ctr509_Edit_MainFormUserControl_ContentItemUserControl_WysiwygDescription_dialogOpener_Window_ClientState" id="dnn_ctr509_Edit_MainFormUserControl_ContentItemUserControl_WysiwygDescription_dialogOpener_Window_ClientState" type="hidden" autocomplete="off">

</div><input name="dnn_ctr509_Edit_MainFormUserControl_ContentItemUserControl_WysiwygDescription_dialogOpener_ClientState" id="dnn_ctr509_Edit_MainFormUserControl_ContentItemUserControl_WysiwygDescription_dialogOpener_ClientState" type="hidden" autocomplete="off">

</div><div class="reRibbonBarWrapper"></div>

<table id="dnn_ctr509_Edit_MainFormUserControl_ContentItemUserControl_WysiwygDescriptionWrapper" style="width: 100%; height: 400px; table-layout: auto;" cellspacing="0" cellpadding="0">

<tbody>

<tr>

<td class="reWrapper_corner reCorner_top_left">&nbsp;</td>

<td class="reWrapper_center reCenter_top" colspan="3">&nbsp;</td>

<td class="reWrapper_corner reCorner_top_right">&nbsp;</td>

</tr>

<tr>

<td class="reLeftVerticalSide" rowspan="4">&nbsp;</td>

<td class="reTlbVertical" id="dnn_ctr509_Edit_MainFormUserControl_ContentItemUserControl_WysiwygDescriptionLeft" rowspan="4"></td>

<td class="reToolCell" id="dnn_ctr509_Edit_MainFormUserControl_ContentItemUserControl_WysiwygDescriptionTop" style="width: 100%;">

<div class="Default reToolbarWrapper">

<ul class="reToolbar Default">

<li class="reGrip grip_first">&nbsp;</li>

<li><a title="Print (CTRL+P)" class="reTool" href="#" unselectable="on"><span class="Print" unselectable="on">&nbsp;</span></a></li>

<li><a title="AJAX Spellchecker" class="reTool" href="#" unselectable="on"><span class="AjaxSpellCheck" unselectable="on">&nbsp;</span></a></li>

<li><a title="Find And Replace (CTRL+F)" class="reTool" href="#" unselectable="on"><span class="FindAndReplace" unselectable="on">&nbsp;</span></a></li>

<li><a title="Select All (CTRL+A)" class="reTool" href="#" unselectable="on"><span class="SelectAll" unselectable="on">&nbsp;</span></a></li>

<li><a title="Cut" class="reTool" href="#" unselectable="on"><span class="Cut" unselectable="on">&nbsp;</span></a></li>

<li><a title="Copy (CTRL+C)" class="reTool" href="#" unselectable="on"><span class="Copy" unselectable="on">&nbsp;</span></a></li>

<li><a title="Paste (CTRL+V)" class="reTool" href="#" unselectable="on"><span class="Paste" unselectable="on">&nbsp;</span></a></li>

<li><a title="Paste Options" class="reTool reSplitButton" href="#" unselectable="on"><span class="PasteStrip" unselectable="on">&nbsp;</span><span class="split_arrow">&nbsp;</span></a></li>

<li class="reSeparator">&nbsp;</li>

<li><a title="Undo (CTRL+Z)" class="reTool reSplitButton" href="#" unselectable="on"><span class="Undo" unselectable="on">&nbsp;</span><span class="split_arrow">&nbsp;</span></a></li>

<li><a title="Redo (CTRL+Y)" class="reTool reSplitButton" href="#" unselectable="on"><span class="Redo" unselectable="on">&nbsp;</span><span class="split_arrow">&nbsp;</span></a></li>

<li class="reGrip grip_last">&nbsp;</li>

</ul><ul class="reToolbar Default">

<li class="reGrip grip_first">&nbsp;</li>

<li><a title="Image Manager (CTRL+G)" class="reTool" href="#" unselectable="on"><span class="ImageManager" unselectable="on">&nbsp;</span></a></li>

<li><a title="Document Manager" class="reTool" href="#" unselectable="on"><span class="DocumentManager" unselectable="on">&nbsp;</span></a></li>

<li><a title="Flash Manager" class="reTool" href="#" unselectable="on"><span class="FlashManager" unselectable="on">&nbsp;</span></a></li>

<li><a title="Media Manager" class="reTool" href="#" unselectable="on"><span class="MediaManager" unselectable="on">&nbsp;</span></a></li>

<li><a title="Template Manager" class="reTool" href="#" unselectable="on"><span class="TemplateManager" unselectable="on">&nbsp;</span></a></li>

<li class="reSeparator">&nbsp;</li>

<li><a title="Hyperlink Manager (CTRL+K)" class="reTool" href="#" unselectable="on"><span class="LinkManager" unselectable="on">&nbsp;</span></a></li>

<li><a title="Remove Link (CTRL+SHIFT+K)" class="reTool" href="#" unselectable="on"><span class="Unlink" unselectable="on">&nbsp;</span></a></li>

<li class="reGrip grip_last">&nbsp;</li>

</ul><ul class="reToolbar Default">

<li class="reGrip grip_first">&nbsp;</li>

<li><a title="SuperScript" class="reTool" href="#" unselectable="on"><span class="Superscript" unselectable="on">&nbsp;</span></a></li>

<li><a title="Subscript" class="reTool" href="#" unselectable="on"><span class="Subscript" unselectable="on">&nbsp;</span></a></li>

<li><a title="New Paragraph" class="reTool" href="#" unselectable="on"><span class="InsertParagraph" unselectable="on">&nbsp;</span></a></li>

<li><a title="Insert Groupbox" class="reTool" href="#" unselectable="on"><span class="InsertGroupbox" unselectable="on">&nbsp;</span></a></li>

<li><a title="Horizontal Rule" class="reTool" href="#" unselectable="on"><span class="InsertHorizontalRule" unselectable="on">&nbsp;</span></a></li>

<li><a title="Insert Date" class="reTool" href="#" unselectable="on"><span class="InsertDate" unselectable="on">&nbsp;</span></a></li>

<li><a title="Insert Time" class="reTool" href="#" unselectable="on"><span class="InsertTime" unselectable="on">&nbsp;</span></a></li>

<li class="reSeparator">&nbsp;</li>

<li><a title="Format Code Block" class="reTool" href="#" unselectable="on"><span class="FormatCodeBlock" unselectable="on">&nbsp;</span></a></li>

<li class="reGrip grip_last">&nbsp;</li>

</ul><ul class="reToolbar Default">

<li class="reGrip grip_first">&nbsp;</li>

<li><a title="Paragraph Style" class="reDropdown" href="#" unselectable="on"><span class="FormatBlock" style="width: 80px;" unselectable="on">Paragraph Style</span></a></li>

<li><a title="Font Name (CTRL+SHIFT+F)" class="reDropdown" href="#" unselectable="on"><span class="FontName" style="width: 80px;" unselectable="on">Font Name</span></a></li>

<li><a title="Real font size (CTRL+SHIFT+P)" class="reDropdown" href="#" unselectable="on"><span class="RealFontSize" style="width: 34px;" unselectable="on">Real font size</span></a></li>

<li class="reGrip grip_last">&nbsp;</li>

</ul><ul class="reToolbar Default">

<li class="reGrip grip_first">&nbsp;</li>

<li><a title="Set Absolute Position" class="reTool" href="#" unselectable="on"><span class="AbsolutePosition" unselectable="on">&nbsp;</span></a></li>

<li class="reSeparator">&nbsp;</li>

<li><a title="Bold (CTRL+B)" class="reTool" href="#" unselectable="on"><span class="Bold" unselectable="on">&nbsp;</span></a></li>

<li><a title="Italic (CTRL+I)" class="reTool" href="#" unselectable="on"><span class="Italic" unselectable="on">&nbsp;</span></a></li>

<li><a title="Underline (CTRL+U)" class="reTool" href="#" unselectable="on"><span class="Underline" unselectable="on">&nbsp;</span></a></li>

<li><a title="Strikethrough" class="reTool" href="#" unselectable="on"><span class="StrikeThrough" unselectable="on">&nbsp;</span></a></li>

<li class="reSeparator">&nbsp;</li>

<li><a title="Align Left" class="reTool" href="#" unselectable="on"><span class="JustifyLeft" unselectable="on">&nbsp;</span></a></li>

<li><a title="Align Center" class="reTool" href="#" unselectable="on"><span class="JustifyCenter" unselectable="on">&nbsp;</span></a></li>

<li><a title="Align Right" class="reTool" href="#" unselectable="on"><span class="JustifyRight" unselectable="on">&nbsp;</span></a></li>

<li><a title="Justify" class="reTool" href="#" unselectable="on"><span class="JustifyFull" unselectable="on">&nbsp;</span></a></li>

<li><a title="Remove alignment" class="reTool" href="#" unselectable="on"><span class="JustifyNone" unselectable="on">&nbsp;</span></a></li>

<li class="reSeparator">&nbsp;</li>

<li><a title="Indent" class="reTool" href="#" unselectable="on"><span class="Indent" unselectable="on">&nbsp;</span></a></li>

<li><a title="Outdent" class="reTool" href="#" unselectable="on"><span class="Outdent" unselectable="on">&nbsp;</span></a></li>

<li class="reSeparator">&nbsp;</li>

<li><a title="Numbered List" class="reTool" href="#" unselectable="on"><span class="InsertOrderedList" unselectable="on">&nbsp;</span></a></li>

<li><a title="Bullet List" class="reTool" href="#" unselectable="on"><span class="InsertUnorderedList" unselectable="on">&nbsp;</span></a></li>

<li class="reSeparator">&nbsp;</li>

<li><a title="Show/Hide Border" class="reTool reTool_selected" href="#" unselectable="on"><span class="ToggleTableBorder" unselectable="on">&nbsp;</span></a></li>

<li><a title="XHTML Validator" class="reTool" href="#" unselectable="on"><span class="XhtmlValidator" unselectable="on">&nbsp;</span></a></li>

<li class="reGrip grip_last">&nbsp;</li>

</ul><ul class="reToolbar Default">

<li class="reGrip grip_first">&nbsp;</li>

<li><a title="Foreground Color" class="reTool reSplitButton" href="#" unselectable="on"><span class="ForeColor" unselectable="on">&nbsp;</span><span class="split_arrow">&nbsp;</span></a></li>

<li><a title="Background Color" class="reTool reSplitButton" href="#" unselectable="on"><span class="BackColor" unselectable="on">&nbsp;</span><span class="split_arrow">&nbsp;</span></a></li>

<li><a title="Apply CSS Class" class="reDropdown" href="#" unselectable="on"><span class="ApplyClass" style="width: 80px;" unselectable="on">Apply CSS Class</span></a></li>

<li><a title="Format Stripper" class="reTool reSplitButton" href="#" unselectable="on"><span class="FormatStripper" unselectable="on">&nbsp;</span><span class="split_arrow">&nbsp;</span></a></li>

<li class="reGrip grip_last">&nbsp;</li>

</ul><ul class="reToolbar Default">

<li class="reGrip grip_first">&nbsp;</li>

<li><a title="Insert Symbol" class="reTool reSplitButton" href="#" unselectable="on"><span class="InsertSymbol" unselectable="on">&nbsp;</span><span class="split_arrow">&nbsp;</span></a></li>

<li><a title="Insert Table" class="reTool reSplitButton" href="#" unselectable="on"><span class="InsertTable" unselectable="on">&nbsp;</span><span class="split_arrow">&nbsp;</span></a></li>

<li><a title="Insert Form Element" class="reTool reSplitButton" href="#" unselectable="on"><span class="InsertFormElement" unselectable="on">&nbsp;</span><span class="split_arrow">&nbsp;</span></a></li>

<li><a title="Insert Code Snippet" class="reTool reSplitButton" href="#" unselectable="on"><span class="InsertSnippet" unselectable="on">&nbsp;</span><span class="split_arrow">&nbsp;</span></a></li>

<li><a title="Image Map Editor" class="reTool" href="#" unselectable="on"><span class="ImageMapDialog" unselectable="on">&nbsp;</span></a></li>

<li><a title="Custom Links (CTRL+ALT+K)" class="reDropdown" href="#" unselectable="on"><span class="InsertCustomLink" style="width: 80px;" unselectable="on">Custom Links</span></a></li>

<li class="reSeparator">&nbsp;</li>

<li><a title="Convert to lower case" class="reTool" href="#" unselectable="on"><span class="ConvertToLower" unselectable="on">&nbsp;</span></a></li>

<li><a title="Convert to upper case" class="reTool" href="#" unselectable="on"><span class="ConvertToUpper" unselectable="on">&nbsp;</span></a></li>

<li class="reSeparator">&nbsp;</li>

<li><a title="Zoom" class="reDropdown" href="#" unselectable="on"><span class="Zoom" style="width: 44px;" unselectable="on">Zoom</span></a></li>

<li><a title="Module Manager" class="reTool reSplitButton" href="#" unselectable="on"><span class="ModuleManager" unselectable="on">&nbsp;</span><span class="split_arrow">&nbsp;</span></a></li>

<li><a title="Toggle Full Screen Mode (F11)" class="reTool" href="#" unselectable="on"><span class="ToggleScreenMode" unselectable="on">&nbsp;</span></a></li>

<li><a title="About RadEditor" class="reTool" href="#" unselectable="on"><span class="AboutDialog" unselectable="on">&nbsp;</span></a></li>

<li class="reGrip grip_last">&nbsp;</li>

</ul>

</div>

</td>

<td class="reTlbVertical" id="dnn_ctr509_Edit_MainFormUserControl_ContentItemUserControl_WysiwygDescriptionRight" rowspan="4"></td>

<td class="reRightVerticalSide" rowspan="4">&nbsp;</td>

</tr>

<tr>

<td class="reContentCell" id="dnn_ctr509_Edit_MainFormUserControl_ContentItemUserControl_WysiwygDescriptionCenter" valign="top" style="height: 100%;"><label style="display: none;" for="dnn_ctr509_Edit_MainFormUserControl_ContentItemUserControl_WysiwygDescriptionContentHiddenTextarea">RadEditor hidden textarea</label><textarea name="dnn$ctr509$Edit$MainFormUserControl$ContentItemUserControl$WysiwygDescription" id="dnn_ctr509_Edit_MainFormUserControl_ContentItemUserControl_WysiwygDescriptionContentHiddenTextarea" style="display: none;" rows="4" cols="20"></textarea><iframe title="Rich text editor with ID dnn_ctr509_Edit_MainFormUserControl_ContentItemUserControl_WysiwygDescription" id="dnn_ctr509_Edit_MainFormUserControl_ContentItemUserControl_WysiwygDescription_contentIframe" src=" '

<html>

</html>';" frameborder="0" style="margin: 0px; padding: 0px; width: 100%; height: 100%;">Your browser does not support inline frames or is currently configured not to display inline frames.</iframe></td>

</tr>

<tr>

<td class="reToolZone">

<table id="dnn_ctr509_Edit_MainFormUserControl_ContentItemUserControl_WysiwygDescription_BottomTable" style="width: 100%;" cellspacing="0" cellpadding="0">

<tbody>

<tr>

<td class="reEditorModesCell">

<div class="reEditorModes" id="dnn_ctr509_Edit_MainFormUserControl_ContentItemUserControl_WysiwygDescription_ModesWrapper">

<ul>

<li><a title="Design" class="reMode_design reMode_selected" href=" void(0);"><span>Design</span></a></li>

<li><a title="HTML" class="reMode_html" href=" void(0);"><span>HTML</span></a></li>

<li><a title="Preview" class="reMode_preview" href=" void(0);"><span>Preview</span></a></li>

</ul>

</div>

</td>

<td class="reBottomZone" id="dnn_ctr509_Edit_MainFormUserControl_ContentItemUserControl_WysiwygDescriptionBottom"><div class="reModule"><span style="line-height: 22px;">Words: 0 &nbsp;&nbsp;Characters: 0&nbsp;</span></div></td>

<td align="right" class="reResizeCell" valign="bottom" style="width: 15px;">

<div id="dnn_ctr509_Edit_MainFormUserControl_ContentItemUserControl_WysiwygDescriptionBottomResizer" style="cursor: se-resize;">

&nbsp;

</div>

</td>

</tr>

</tbody>

</table><noscript>

&lt;p&gt;RadEditor - please enable JavaScript to use the rich text editor.&lt;/p&gt;

</noscript>

</td>

</tr>

<tr>

<td class="reToolZone" id="dnn_ctr509_Edit_MainFormUserControl_ContentItemUserControl_WysiwygDescriptionModule"><div class="reModule">&nbsp;</div><div class="reModule" style="height: 50px;"></div><div style="display: none;"></div></td>

</tr>

<tr>

<td class="reWrapper_corner reCorner_bottom_left">&nbsp;</td>

<td class="reWrapper_center reCenter_bottom" colspan="3">&nbsp;</td>

<td class="reWrapper_corner reCorner_bottom_right">&nbsp;</td>

</tr>

</tbody>

</table><input name="dnn_ctr509_Edit_MainFormUserControl_ContentItemUserControl_WysiwygDescription_ClientState" id="dnn_ctr509_Edit_MainFormUserControl_ContentItemUserControl_WysiwygDescription_ClientState" type="hidden" autocomplete="off">

 
New Post
4/11/2014 11:13 AM
 

Hello,

Just thinking about it, the error message: 'RadEditor - please enable JavaScript to use the rich text editor.'

wasn't displayed, so I assume it's just there in case there's a problem rather than being the problem.

I was too eager to think I'd found the issue :-)

As a last resort, I tried getting the text box content via JQuery:

var editor = $("#<%=WysiwygDescription.ClientID%> #<%=WysiwygDescription.ClientID%>ContentHiddenTextarea");

But only retrieves the original text, not the changes added by a user.

I think it's time to give up and use a JQuery plugin instead :-(

Steve

 
New Post
4/12/2014 1:59 PM
 

Hi Stephen,

This is not related to DNN but to the way the Telerik control works! You should read the Telerik documentation to use functions (like get_html) from the client side API. You can find a sample of the client API in the demo section.

When you use the following code:

var editor = $(Container.find("#DNNEDITCONTROL"));

you DON'T get a reference to the javascript object containing the get_html function but a reference to the DOM element named #DNNEDITCONTROL. In other words, you get a reference to a div element! :-) The div element IS NOT the editor object, you are on the client side NOT inside ASP.NET!

To get a reference to the javascript object linked to the editor, you have to use the following code:

    <dnn:DnnEditor ID="DNNEDITCONTROL" runat="server" OnClientLoad="editorLoaded"></dnn:DnnEditor>

    <input id="btnTest" type="button" value="Click Me!" />

    <script type="text/javascript">

        var editor = null;

        function editorLoaded(sender) {

            editor = sender;

        }

        $("#btnTest").click(function() {

            var content = editor.get_html(true);

        });

    </script>

First the OnClientLoad attribute of the DnnEditor control is set with the name of the javascript function to run just after the editor is completly loaded. This function have a sender parameter containing the reference to the javascript object editor, this reference is saved in the global editor variable for later use.

Second, I added a delegate event handler on the click of the input button named btnTest. When you click on this button you use the editor variable to call the get_html function and you get the html content of the editor instance.

Finally, I do not understand why you need to get the html content from the client side! May be you want to submit it to a web service!?

Gilles


We (team members) are Humans offering their knowledge, their work and their spare time FOR FREE to benefit the community. It would be so particularly appreciated that your messages begin with "Hello" and end with "Thank you" or any other form of politeness. Ask yourself what your reaction would be, if you were approached by me (a total stranger) on the street to ask you something without saying "Hello" nor "Thank you"? After several years of services dedicated to the community, I begin to be tired to read requests without any form of politeness.
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Getting StartedGetting StartedUsing the Telerik editor controlUsing the Telerik editor control


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out