Fire( COMMAND_NAME, oTool)
The example below will call the Format Stripper tool with the [Strip All Formatting] option, i.e:
| ASPX/ASCX |
Copy Code |
|
<rad:RadEditor Editable="true" id="RadEditor1" Runat="server"> </rad:RadEditor> <script type="text/javascript"> RadEditorCommandList["MyCustomTool"] = function(commandName, editor, oTool) { //You can perform specific actions here, and call an existing (or another custom) editor's command //The example below will call the Format Stripper tool with the "Strip all Formatting" option oTool = new Object(); oTool.GetSelectedValue = function() { return "ALL"; } editor.Fire("FormatStripper", oTool); }; </script> |
 |
The custom command should be placed BELOW the editor declaration. |
Arguments:
COMMAND_NAME - the command name as it is specified in the editor tools' file
editor - an instance of the editor
oTool - a tool that fired the command (usually a button or a dropdown)
See Also