RadEditor for ASP.NET

CancelEdit Send comments on this topic.
Client-side API Reference > Methods > CancelEdit

Glossary Item Box

Cancels the editing.

function CancelEdit()


The following example demonstrates how to shift the update and cancel buttons to the editor's toolbar:

  1. To hide the standard Update / Cancel buttons, set the ShowSubmitCancelButtons property to "false".
  2. After that open the ~/RadControls/Editor/ToolsFile.xml file and declare the Update and Cancel toolbar buttons

    <tool name="Save" />  
    <tool name="Cancel" />  
  3. The last step is to add their javascript commands under the editor's declaration:
ASPX/ASCX Copy Code
<rad:RadEditor ID="RadEditor1" SaveInFile="true" ShowSubmitCancelButtons="false" runat="server"></rad:RadEditor>
<
script type="text/javascript">
if (typeof(RadEditorCommandList) != "undefined")
{
   
RadEditorCommandList["Save"] = function(commandName, editor, oTool) { editor.Submit(); }
   
RadEditorCommandList["Cancel"] = function(commandName, editor, oTool) { editor.CancelEdit(); }
}
</script>