#10663 closed Bug (invalid)
problems with the setData function
Reported by: | Avital | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | 4.1.1 |
Keywords: | Cc: |
Description
Hello,
I have a big problem with the setData function, after using it many of the editor button stop working(disable), like undo, redo, colors, font and more. Another effect of that is that events stop working, like onchange plugin for example. Another issue is in IE, i get Access denied error when i am trying using instanceReady event.
Is there alternative way to change all data?
Thanks, Avital
editor.setData(newEditorData);
Attachments (1)
Change History (8)
comment:1 Changed 11 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:2 Changed 11 years ago by
You can download the project from here: https://docs.google.com/file/d/0Bw7vmvkiNZBeNDVHTnBvc2VvZmc/edit?usp=sharing
comment:3 Changed 11 years ago by
- If possible could you please send reduced project that only shows this problem and not whole project? But before you do that...
- I have noticed that you are using CKEditor for JavaScript only. For projects like ASP.NET you should use CKEditor for ASP.NET. I know this is still version 3.6.4 but you can update client side code to latest 4.x while having 3.6.4 server side code.
Please also note that you may use CKE 4.2 client-side with CKe ASP.NET 3.6.4 server side.
- Go to CKEditor site and download CKE 4.2 FULL Package
- Extract it into ckeditor folder
- Go to ckeditor_aspnet/_Samples/ and replace existing ckeditor folder with the one you have downloaded.
The only thing you won't be able to set from ASP.NET Control is ACF:
http://ckeditor.com/blog/Upgrading-to-CKEditor-4.1 http://ckeditor.com/blog/CKEditor-4.1-RC-Released http://docs.ckeditor.com/#!/guide/dev_advanced_content_filter http://docs.ckeditor.com/#!/api/CKEDITOR.filter-method-addTransformations http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-allowedContent http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-extraAllowedContent[[BR]]
which you would have to configure or disable from config.js file.
comment:4 Changed 11 years ago by
Hi j.swiderski,
I appreciate your quick response, here are my replies:
- I have removed any unnecessary files from the project, but left the basic structure that reflects our project.
The link: https://docs.google.com/file/d/0Bw7vmvkiNZBeT1V4LWJXcFRfb0U/edit?usp=sharing
- We aren't using CKEditor for ASP.NET, as our solution is a client only component, and uses javascript and knockout only.
More details:
- We initialize the editor in the freeStyleEditorHandler binding handler in the homeScript.js.
- When page is loaded (in IE), and text is entered in editor- notice that there's no undo/redo buttons.
- After choosing <source> and then clicking it again to get back, format buttons (text color, bg color, etc.) are disabled.
- After choosing <source> and then clicking it again to get back, the 'onchange' event stops firing (except for 'Enter' button).
Please reply as soon as possible, We are in the QA stage and have little time before we launch.
Thanks.
comment:5 Changed 11 years ago by
Hi,
It seems to me that all of these issues might have 1 or two reasons.
- Please check what is inserted into editor because this might be some invalid html that is breaking editor:
var editorData = $('<html>').html(editor.getData()); var newEditorData = "<html>" + editorData.html() + "<html>"; //after setData run all buttons stop working (UNDO/REDU for example) //remove setData line and you will see everything is working fine. editor.setData(newEditorData);
I don't quite inderstand what do you want to do here. When mode changes to wysiwyg you get data from editor and insert it once more. Please check what gets inserted as this may be the key thing here.
- This is just a guess as I didn't wasn't able to check working code. For some reason I wasn't able to fire application and I'm not .NET expert but here is the question... are you sure that your knockout doesn't for example rebind events (duplicates them) which simply breaks editor?
Changed 11 years ago by
Attachment: | simpleCKEditorExample.rar added |
---|
This is simple example of the bug - in IE only
comment:6 Changed 11 years ago by
Hello j.swiderski,
Thanks for the quick response, I Attached a new simpler example that contains only one html page + 1 script page + ckeditor. I removed all Knockout, now it's pure jquery and javascript...
About your request, when mode is 'wysiwyg' I am trying to change the data to another html (because my editor configured to be in full html mode). You can test it with just text (textData variable) or with html (htmlData variable) (I added both of the options) - it's not work either way... My purpose is: Our site will be secured and when someone insert at source mode http image, I need to change it to https...
Please check only in IE...
Thanks, Avital.
comment:7 Changed 11 years ago by
DUP of #10501.
@4avital you are right this is happening only in IE and this is known problem. Please try using below:
setTimeout(function(){editor.setData(htmlData);},10);
It has even worked for me when I used 0 for time interval.
You have written that you have error with code you are using and nothing more.
I know that setData works thus I'm closing this issue as invalid for now.
@4avital please provide exact step by step scenario that allows reproducing this bug. If possible please provide reduced sample code that allows reproducing this problem.