All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:
I want to use the Radeditor to edit HTML data. However, I have a special image editor that I want to execute when the user double clicks on certain images in the document. Is this possible with Radeditor? Can I execute Javascript in the editor?
Thanks,
Arthur
Hi Arthur,
You can see how to attach to the ondblclick event of the iframe-based content area of RadEditor in this article: Open Link in a New Window on Double Click, e.g.
<script type="text/javascript"> function OnClientLoad(editor, args) { editor.attachEventHandler("ondblclick", function (e) { var sel = editor.getSelection().getParentElement(); //get the currently selected element var href = null; if (sel.tagName.toLowerCase() == "img") { alert("do something with the selected image"); return false; } } ); } </script> <telerik:RadEditor runat="server" ID="RadEditor1" OnClientLoad="OnClientLoad"> <Content> Sample Content <img src="https://docs.telerik.com/devtools/aspnet-ajax/assets/Avatar-Ninja-big.svg" /> Sample Content </Content> </telerik:RadEditor>
Hi Arthur,
You can see how to attach to the ondblclick event of the iframe-based content area of RadEditor in this article: Open Link in a New Window on Double Click, e.g.
<script type="text/javascript"> function OnClientLoad(editor, args) { editor.attachEventHandler("ondblclick", function (e) { var sel = editor.getSelection().getParentElement(); //get the currently selected element var href = null; if (sel.tagName.toLowerCase() == "img") { alert("do something with the selected image"); return false; } } ); } </script> <telerik:RadEditor runat="server" ID="RadEditor1" OnClientLoad="OnClientLoad"> <Content> Sample Content <img src="https://docs.telerik.com/devtools/aspnet-ajax/assets/Avatar-Ninja-big.svg" /> Sample Content </Content> </telerik:RadEditor>