Reputation: 199
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();
});
Upvotes: 1
Views: 1030
Reputation: 592
With CK Editor 5:
To reset undo/redo state, use:
editor.setData(newData);
// OR
editor.data.set(newData);
To keep undo/redo state, use:
editor.data.set(newData, {batchType: {isUndoable: true}});
Upvotes: 0
Reputation: 26
After the trouble of searching the clock All roads do not work I do not know the reason
The solution is
CKEDITOR.instances.editor1.setData('Text_Html',function() { this.resetUndo(); });
Upvotes: 1
Reputation: 3151
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
Upvotes: 0