Hi,
i have a single html page with mulitple div elements on it. Each time a user clicks on on a div, it is replaced with an CKEditor on the fly:
Now, if the CKEditor instance loses its focus (blur event), i need to post the content to a separate script via ajax (if something changed) and destroy this instance:
But this example won't work because, i don't know why, destory() will be called before (?!) checkDirty(). How can i get this working?
Thank you very much
i have a single html page with mulitple div elements on it. Each time a user clicks on on a div, it is replaced with an CKEditor on the fly:
$('.editable').click(function() {
editor = CKEDITOR.replace(this);
});Now, if the CKEditor instance loses its focus (blur event), i need to post the content to a separate script via ajax (if something changed) and destroy this instance:
$('.editable').click(function() {
editor = CKEDITOR.replace(this);
editor.on('blur', function(e)
{
if (e.editor.checkDirty())
// get data with e.editor.getData() and do some ajax magic
e.editor.destroy();
});
});But this example won't work because, i don't know why, destory() will be called before (?!) checkDirty(). How can i get this working?
Thank you very much
