ckeditor 4.9.2 instanceDestroyed事件未触发

时间:2018-09-04 06:57:53

标签: javascript ckeditor4.x

我已将ckeditor从4.4.6升级到4.9.2。升级后,观察到编辑器的“ instanceDestroyed”事件没有被触发。我的应用程序已订阅了编辑器的不同事件,例如“ instanceCreated”,“ instanceReady”和“ instanceDestroyed”。除“ instanceDestroyed”外,其余事件均按预期触发。事件'instanceDestroyed'的代码如下:

CKEDITOR.on( 'instanceDestroyed', function(event) {
    editorState[event.editor.name] = "DESTROYED" ;      
});

是否有解决此问题的建议?

1 个答案:

答案 0 :(得分:0)

对于docs,不应在CKEDITOR实例上触发。您必须收听小部件存储库的更改,如下所示:

CKEDITOR.widgets.on( 'instanceDestroyed', function(event) {
   editorState[event.editor.name] = "DESTROYED" ;      
});