简体   繁体   中英

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

I want reset the undo functionality after set Data method in ckeditor.

any one know please let me know.

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

Use 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.

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

resetUndo

The solution is

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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