什么时候是一个ckeditor实例好,真正加载? [英] When is a ckeditor instance well and truly loaded?

查看:141
本文介绍了什么时候是一个ckeditor实例好,真正加载?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在CKEDITOR实例被正确加载后操作它,这意味着我已经获取了一系列的东西,并用setData插入它们。

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.

是,我调用一个函数,一旦我做了setData操纵加载的数据的DOM,它不做任何事情,因为显然数据没有实际加载和显示或...无论是CKEDITOR做什么它确切。如果我做一个setTimeout(....,3000)或者那里,它的工作。当然,这是一个丑陋的Hack,因为数字只是一个随机猜测。我想要某种类型的事件,我可以锁定,这让我知道,潜入编辑器的内容,并开始摆弄他们是确定。

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.

尝试在'loaded',on'instanceReady'和其他各种回调没有大的成功。

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

推荐答案

'contentDOM'可能是胜者:

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

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

这篇关于什么时候是一个ckeditor实例好,真正加载?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆