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:43 AM
 

Hello,

I'm trying to use the Editor control, which displays ok but I can't access via Javascript.

All I want to do is get the html generated by the editor, but obviously i must be missing something as the get_html function, please see my code below, does not exits. I adapted the code from the example shown here:

http://www.telerik.com/help/aspnet-aj...

Can anyone please help? 

Is there a resource which explains how to use the controls from a DNN perspective?

Best Regards,

Steve

 

ASCX

=====


<%@ Register Assembly="DotNetNuke.Web" Namespace="DotNetNuke.Web.UI.WebControls" TagPrefix="cc1" %>



<cc1:DnnEditor ID="DNNEDITCONTROL" ClientIDMode="Static"  runat="server"></cc1:DnnEditor>





Javascript

========

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



    var oSelElem = editor.get_html(true); 



    SelElem);







 
New Post
4/10/2014 8:18 AM
 

your code is not quite right -whilst the control is called DNNEDITCONTROL, asp.net has the concept of "naming containers" i.e. that the page or particular block elements (e.g. divs) are containers for other controls. As such asp.net builds up a control name based on where it lies and whether the control itself has subcontrols e.g. in the case of the html module here it's full name is "dnn_ctr1565_Forum_PostEdit_teContent_teContent_contentDiv"

As such the correct way to assess content such as this is to use a server-side block (<% %>) and use the controls clientid - the article you linked do so http://www.telerik.com/help/aspnet-aj... so tweaking it to something such as this should work:

var editor = $(Container.find("<%=DNNEDITCONTROL.ClientID%>")); 


Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
4/10/2014 9:42 AM
 
Hi Cathal,

Thank you for your reply.

I thought I would be able to use the id as I set ClientMode to Static, the ID was set to DNNEDITCONTROL in the generatated JavaScript.

But I've also tried the following:
var editor = $(Container.find("<%=DNNEDITCONTROL.ClientID%>"));
var editor = $(Container.find("#<%=DNNEDITCONTROL.ClientID%>"));

But they don't work unfortunately, simply cause the control to do a page re load.

Is there anything else that I can try?

Best Regards,

Steve


 
New Post
4/10/2014 11:18 AM
 
ah, yes, a static name is fine and should work with your earlier solution. However it's not, so I suspect it's targeting the frame of the content rather than the div that contains the content - probably best to press F12 (or use firebug in firefox) to load the developer tools and then use the option to identify the DOM element, it might offer a clue why this isn't working

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
4/10/2014 12:09 PM
 

Hi Cathal,

Thank you for your reply.

Code now generated as:

var editor = Container.find("#dnn_ctr509_Edit_MainFormUserControl_ContentItemUserControl_WysiwygDescription");

var oSelElem = editor.get_html();

Just used the debugger in Firefox, got the following error message:

object doesn't support property or method 'get_html'.

Best Regards,

Steve

 
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