Hi,
I am using radEditor control in a web application in which i want to implement the context menu, where the labels of the context menu should be as per my specification.
How can I use labels as per my specification?
Thanks
Vikram
1 Answer, 1 is accepted
0
Rumen
Telerik team
answered on 26 Mar 2009, 01:15 PM
Hi Vikram,
You can create your own custom menu using the oncontextmenu event of RadEditor:
<script type="text/javascript">
function CallContextMenu(editor)
{
editor.attachEventHandler ("oncontextmenu", function (e)
{
var oSelection = editor.getSelection().getParentElement(); //get the selected element
if(oSelection.tagName == "IMG")
{
alert("the 'e' argument returns the mouse position " + e);
alert("get a reference to the editor's body " + editor.get_document().body);
alert("the selected element is " + oSelection.tagName);
}
});
}
</script>
<telerik:RadEditor runat="server" ID="edContent" OnClientLoad="CallContextMenu">
<Content>sample content <br/> sample content <img src="" /></Content>
</telerik:RadEditor>
Best regards,
Rumen
the Telerik team
Check out
Telerik Trainer
, the state of the art learning tool for Telerik products.