Opened 14 years ago
Closed 13 years ago
#6435 closed Bug (invalid)
Modifications to the document aren't reflected in the preview window
Reported by: | Tobi Reif | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | |
Keywords: | Cc: |
Description
Some snipped example lines:
var selected = editor.getSelection().getSelectedElement(); if (selected.getName() == 'foo') {
selected.setAttribute('some_attribute',bar); ...
This works, but the change is not reflected in CKEditor's preview window. getData() might also not have the modified HTML code.
I had asked in the forum: "How to (using JS) modify the HTML code of the document in the proper way - so that it will really be changed: so that I can expect the preview window (and the data from getData() ) to reflect these changes."
But didn't get a general solution.
Thus far I consider this a bug.
How to modify the HTML code of the document in a way that causes the preview window (and the data from getData() ) to reflect these changes?
Perhaps this link will be helpfull http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dom.range.html
Selection should be rather made with:
The above works fine (checked under latest CKEditor 3.6.2).
You have said that editor.getData() doesn't return updated values. If for some reason the above will not work you can try firing saveSnapshot event manually before getting the data.
Anyway I'm closing the ticket as invalid.