← 全部文档

exec_command 和 exec_command_* 事件

每当执行一个 ExecCommand 时,都会触发 exec_command_* 事件。

运行某个具体命令时,会触发对应的特定事件,例如 exec_command_newdoc。

语法

function(state,cmd,value)

用法示例

editor1.attachEvent("exec_command_newdoc", function (state, cmd, value) {
    state.returnValue = true;//handled, don't execute default action
    this.setHTMLCode("<p>NewDoc...</p>");
});