I'm using CKEditor 4's inline editing feature in a page in wich I dynamically detach, remove, append, reappend and add contenteditable="true" elements to the DOM with jQuery. I have encountered the folowing problems:
- The CKEditor inline editing instances in reappended elements doesn't work.
- Can't create a CKEditor inline editing instance in newly added elements.
- Using the jQuery adapter ($(...).ckeditor()) creates a regular instance, not an inline editing one.
- Calling CKEDITOR.inlineAll(); doesn't give new elements an inline editing instance nor repairs the reappended element's ones.
Report your issues
Please open tickets for your issues at the CKEditor dev site: http://dev.ckeditor.com/. Be sure to have separate tickets for each issue.
Frederico Knabben
CKEditor Project Lead and CKSource Owner
--
Follow us on: Twitter | Facebook | Google+ | LinkedIn
Similar issue with updated inline divs
When div containers set with contenteditable="true" are updated from the server and CKEDITOR.inlineAll() is applied the divs are not editable.
If I put a break on that command in Firebug and then click the continue button some of the divs are now editable, but not all.
I'm using prototype 1.7.1 to get the updates from the server.
In the initial page load just before the closing body tag i have
<script type="text/javascript">
CKEDITOR.disableAutoInline = true;
</script>
Dennis
Has there been any resolution
Has there been any resolution to this?
Solution
After you append contenteditable="true" elements to the DOM with jQuery, then destroy all existing ckeditor inline and call CKEDITOR.inlineAll to initialize all ckeditor inline.
Good luck
Does not work for me...
I have exact the same situation, loading divs that need to be editted, but above solution does NOT work.
works for me
the solution where you destroy and inlineAll didnt work for me as well .
but this one worked for me:
delete CKEDITOR.instances[instancename];
var editor = CKEDITOR.inline(document.getElementById(instancename));
not sure how bad it is to use delete instead of using destroy.
Is there any solution jet for
Is there any solution jet for creating inline editing instances for newly added elements?
I have the same problem and can't find a solution...
Update:
After many search attempts with my friend Google, I came up with the following solution thats works for me (using jQuery). I just copied the most important pieces of code.
My clonedElement contains a unknown amount of div elements which could be editable, thats why I use a loop.
Hope this helps for someone.
It is very wrong to delete
It is very wrong to delete CKEditor instance this way ;) You should use editor.destroy() method instead. So in your case it would be:
Piotrek (Reinmar) Koszuliński
CKEditor JavaScript Developer
--
CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+
Hey Mike can you help me?
Hey Mike can you help me?
I'm trying to add some editable template into my container with a button but I cannot obtain any result.
I want to create a button that add for example this template at the end of my container...
Thank you
What JS are you using to add
What JS are you using to add the template to the end of your container?
Another working solution
I also have another working solution. Don't know if is the best one. After I do all my changes in the dom I execute this code. This way is done in the end and not in every change. But this was just my case. Posting here if anyone have the same problem.
destroyEditorInstances();
CKEDITOR.inlineAll();
function destroyEditorInstances() {
for (var instance in CKEDITOR.instances) {
CKEDITOR.instances[instance].destroy();
}
Has there been any resolution
Has there been any resolution to this?