Hello,
I am trying to paste HTML into the RadEditor in Design Mode using javascript by clicking a button outside the editor .
When I just call the editor's pasteHtml method , the html is always inserted at the beginning of the editor. To get the html to paste into the last cursor position I am using the code shown below. The problem is that when I call restorePoint.select(), all contents of the editor are selected and replaced instead of the html being placed at the previous cursor position. Any help is appreciated.
This function fires on the editor's OnClientLoad event:
This is the code that's called when pasting the html:
Thanks,
Craig
I am trying to paste HTML into the RadEditor in Design Mode using javascript by clicking a button outside the editor .
When I just call the editor's pasteHtml method , the html is always inserted at the beginning of the editor. To get the html to paste into the last cursor position I am using the code shown below. The problem is that when I call restorePoint.select(), all contents of the editor are selected and replaced instead of the html being placed at the previous cursor position. Any help is appreciated.
This function fires on the editor's OnClientLoad event:
function EditorOnClientLoad()
{
var editor = $find(EditorID);
var element = document.all ? editor.get_document().body : editor.get_document();
$telerik.addExternalHandler(element,
"blur", function(e)
{
restorePoint = editor.createRestorePoint();
}
);
}
This is the code that's called when pasting the html:
restorePoint.select();
$find(EditorID).pasteHtml(html);
Thanks,
Craig