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

Fire Command

1 Answer 89 Views
Editor
This is a migrated thread and some comments may be shown as answers.
HelloULi
Top achievements
Rank 1
HelloULi asked on 02 Jul 2008, 10:38 AM
I use client api Fire method to run "Copy"\"Cut"\"Paste" commands, but they did not run. Is there any other information needed to run these commands ?

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 02 Jul 2008, 10:47 AM
Hi,

We need to research more time why the Fire method does not execute the Cut, Copy and Paste commands, but it is most likely due to browser restrictions. Nevertheless, it is quite easy to override the built-in editor's Copy and Paste commands with the following code and execute the browser Copy and Paste commands:

<telerik:RadEditor ID="RadEditir1" runat="server"></telerik:RadEditor>
<script type="text/javascript">
Telerik.Web.UI.Editor.CommandList["Copy"] = function(commandName, editor, args)
{     
      editor.setFocus();
      editor.get_document().execCommand('Copy'); 

};

Telerik.Web.UI.Editor.CommandList["Paste"] = function(commandName, editor, args)
{     
      editor.setFocus();
      editor.get_document().execCommand('Paste'); 

};
</script>


Greetings,
Rumen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Editor
Asked by
HelloULi
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or