When is a ckeditor instance well and truly loaded?

孤人 提交于 2019-12-11 18:23:44

问题


I want to manipulate a CKEDITOR instance once it is well and truly loaded, meaning I've fetched a series of things and inserted them with setData.

The problem is, I call a function once I'm done doing setData that manipulates the DOM of the loaded data, and it does nothing, because apparently the data hasn't actually been loaded and displayed or... whatever it is that CKEDITOR does with it exactly. If I do a setTimeout(...., 3000) or thereabouts, it does work. Of course, that is an Ugly Hack because the number is just a random guess. I want some kind of event that I can latch on to, that lets me know that it's ok to dive into the editor's contents and start fiddling with them.

I've tried on 'loaded', on 'instanceReady' and various other callbacks without a great deal of success.


回答1:


It looks as though 'contentDOM' may be the winner:

editor.on('contentDom', function(e) {
set_up_style_stuff();
});


来源:https://stackoverflow.com/questions/6322284/when-is-a-ckeditor-instance-well-and-truly-loaded

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!