简体   繁体   English

在setData之后,有什么方法可以在ckeditor中重置撤消吗?

[英]Is there any way to reset undo in ckeditor after setData?

I want reset the undo functionality after set Data method in ckeditor. 我想在ckeditor中设置Data方法后重置撤消功能。

any one know please let me know. 任何人都知道,请告诉我。

editor.setData(content,function(){
    this.checkDirty();
});

Use resetDirty() 使用resetDirty()

Resets the "dirty state" of the editor so subsequent calls to checkDirty will return false if the user will not have made further changes to the content. 重置编辑器的“脏状态”,因此,如果用户未对内容进行进一步更改,则随后对checkDirty的调用将返回false。

alert( editor.checkDirty() ); // e.g. true

editor.resetDirty();

alert(editor.checkDirty() ); // false

After the trouble of searching the clock All roads do not work I do not know the reason 麻烦搜索时钟后,所有道路都不通,我不知道原因

reset 重启

resetDirty resetDirty

resetUndo resetUndo

The solution is 解决方案是

CKEDITOR.instances.editor1.setData('Text_Html',function() { this.resetUndo(); });

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM