Executes an editor command with onSuccess and onError handlers.
.executeCommandEx(/*String*/ commandName, /*Function*/ onSuccess, /*Function*/ onError, [parameters])
The name of the command to be executed. This must be a valid command name. More information on editor commands is available here.
A function with no parameters. This function will be called when the command has been executed successfully.
A function that accepts one parameter, an Error object. This function will be called if the command fails. The passed Error object indicates the nature of the failure.
Commands may have parameters. More information on the parameters for each editor command is available here.
// Enable the grid. editor.executeCommandEx('enableGrid', onSuccess, onError, true); ... // Start a line drawing operation. editor.executeCommandEx('draw_line', onSuccess, onError);