I'm trying to create an ExtJS extension but I'm missing two important events in CKEditor.
- render: I often get an error that the editor or a function doesn't exist yet right after creating a CKEditor instance. An 'onready' or 'render' event could solve a lot of these situations. Alternatively the possibility to define a callback function when initiating the editor. Is this already possible?
- change: I don't know if this is possible, but a change event which is fired when the content is changed would be very useful. I'm currently using a task in ExtJS that calls the checkDirty() function regularly. But, obviously, this isn't a very good solution.
I also would like to create CK events on my own. Something like
event = new CKEDITOR.event(DOMevent);
The result should be the same as the event object that gets passed to listener functions. Currently you get only an object with some functions. The objects mentioned in CKEDITOR.eventInfo (sender, data, etc) in the docs are almost all missing.
One has to figure out a lot on his own. I find the api documentation lacking a lot of information...
Re: events
You're looking for the "instanceReady" event. This event is fired for both the CKEDITOR object and the specific editor instance. For example:
Check out this ticket: http://dev.fckeditor.net/ticket/900
I'm afraid there is no support for it at this time, because it's still unclear on how this could used in the real world. Maybe you can give us some light on this.
I'm sorry to hear it... CKEditor is a huge application so it's definitely important to have good documentation. We'll be working on it.
Frederico Knabben
CKEditor Project Lead and CKSource Owner
--
Follow us on: Twitter | Facebook | Google+ | LinkedIn
Re: events
This is what I was looking for, thanks! This also shows a problem I have with the docs, I can't find any references to any events. A fulltext search of the api directory only shows 1 source file with the term "instanceReady", I don't think it's even documented?
I already had a feeling that this isn't easy to do. Thanks for the clear up!
I have a function which I call from events within CKEditor and from event functions in ExtJs. So it gets called either with a CKEditor or an ExtJs eventobject. Altough undocumented, you can create eventobjects in Ext from browserevent-objects:
I thought it would be nice to have that functionality too. But I think I can easily rewrite that function. No biggy...
Re: events
If you haven't done so, take a look at the ExtJs documentation. It's awesome. Eg. try http://extjs.com/deploy/ext-3.0.0/docs/ ... Ext.Button . It documents all properties, methods and events very well.
Re: events
I am working on the same task, i.e. an ExtJS wrapper for CKEditor ending up at the same problem (that's how I found this post anyway). Did you succeed getting it to work? When creating a new editor instance, "instanceReady" still seems to be too early to call editor.resize. In case you made more progress on that I would be more than happy to learn about it.
Thanks,
Henning
Re: events
Henning