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

HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...radeditor using OnClientLoad eventradeditor using OnClientLoad event
Previous
 
Next
New Post
8/22/2014 8:08 AM
 

I have read this example http://radeditor.codeplex.com/wikipage?title=OnClientPasteExample and have managed to get this working. The problem is that in the editor configuration there is only the "Command Executing" and "Paste HTML" events. I want to use "OnClientLoad" event. How do i go about doing that?

BTW what i really want is to add an onkeyup event but according to the radEditor doc i need to use

function onclientload(editor, args) {

        editor.attacheventhandler("onkeyup", function (e) {

              //code goes here

        });

}

Also i have tried
<%@ Register TagPrefix="dnn" TagName="TextEditor" Src="~/controls/TextEditor.ascx"%>

<dnn:TextEditor ID="textEditor" OnClientInit="OnClientInit" runat="server" />

but no luck

 
New Post
8/22/2014 9:49 AM
 
I dont think this is the best solution because it involves modifying a file which shouldnt be modified and i cannot just install my module to get it to work. Nevertheless this is what i did

in the config.xml file add property (sorry for missing characters)

property name="OnClientInit" 
OnClientInit 

property

If anyone can give me a solution which doesn't involve modifying existing files please let me know.

 
New Post
9/30/2014 5:29 PM
 

Thomas, I did something very close to what you were trying to do and here's what I came up with.

Instead of adding the OnClientLoad to the RadEditor tag, I just attached a function to the very end of the page load and connected it there.

// Attach a handler to the load event. - must load after everything else
Sys.Application.add_load(CreateContextMenu);

// Add the event handler
function CreateContextMenu() {
    var editor = $find("theEditorId");
    editor.attachEventHandler ("oncontextmenu", function (e)
    {
      var oSelection = editor.getSelectedElement();
      if(oSelection.tagName == "IMG")
      {
          // do stuff
         $telerik.cancelRawEvent(e);
          return false; //disable the browser's context menu
      }
   });
}

This way I didn't have to touch any core code.  Hope it helps.

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...radeditor using OnClientLoad eventradeditor using OnClientLoad event


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