What is Voofie?
Voofie organizes knowledge, discovers useful resources and recognizes knowledgable users.
Bookmark your blog in Voofie to get more traffic as well as building a reputation in your field!
Explore more about it. Become a member—our FREE Registration takes just seconds.
shiraz
getting reference of richcombo from ckeditor instance
Hi ;
I have developed a custom richCombo plugin for CK Editor . I am able to add static items in the init method of the plugin .
But how do I add dynamic items to the combo which I want to add once the Editor is ready . I am getting access to the editor object once it is ready but how do I access the richcombo object/ custom plugin object from the editor to manipulate its list.
George Wu (georgewu)
The simplist way is to access the functions inside the plugin directly by writting something like this:
Then you can access the function through editor.somefunction.
Alternatively, you can create a class for the plugin. The contextMenu plugin that comes with CKEditor is a great example for this. Simply follow the skeleton and you can achieve what you want.
Reply
shiraz
Thanx George for your reply .
I get what you are saying is to access the editor from within the plugin .But how do I achieve something the other way around . For example in FCK editor we can get hold of a toolbar item using the following way
editorInstance.EditorWindow.parent.FCKToolbarItems.LoadedItems['toolbarItem'].
Is there something similar in CKEditor
This would allow me to access one toolbar item/plugin from another toolbar item/plugin.
Reply
George Wu (georgewu)
Using the way I described, you can simply call something like "editorInstance.somefunction()" from elsewhere in CKEditor after the plugin has been loaded. This way is probably the simplist.
So far as I know, there is no simple way of getting a toolbar item in CKEditor. There is several way of implementing a plugin, and if you want to access a plugin in object form, you will have to write a class for the plugin using CKEDITOR.tools.createClass. Here's an example from contextMenu plugin to illustrate how to do it:
Reply