Opened 11 years ago
Closed 10 years ago
#11986 closed Bug (expired)
SetData doesn't load content ckeditor 4.4
Reported by: | Alex | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | |
Keywords: | Cc: |
Description
I'm using the following code to populate data, this issue happens in chrome only, Jquery dialog opens with ckeditor, clears previous content and loads a new one with Ajax call. Sometimes content doesn't load, I able to reproduce it each time I open chrome developer tool in a background. Just press F12 and open jquery dialog with ckeditor inside, after opening web developer tool this error also randomly recreated with developer tool off. When I debug it I can see that second setData doesn't load Dto.HtmlContent
Chrome version: Version 34.0.1847.137 m Windows 7 I have disabled chrome plugins.
function Load(ID) { ShowEditorDialog(); $('#Dialog').append(loader); CKEDITOR.instances['CkEditorTxt'].setData("", function () { PostAsyncAjax("GetData", { 'ID': ID}, function (data) { var Dto = data.d; CKEDITOR.instances['CkEditorTxt'].setData(Dto.HtmlContent); $('#Loader').remove(); } ); }); return false; }
Attachments (1)
Change History (10)
Changed 11 years ago by
Attachment: | build-config.js added |
---|
comment:1 Changed 11 years ago by
Keywords: | setData ckeditor removed |
---|---|
Status: | new → pending |
Version: | 4.4.0 |
Could you simplify the test case so we can run it on our machines? It's impossible to reproduce your TC now because it contains too much of custom, hidden logic.
comment:2 Changed 11 years ago by
Here is simplified snippet without hidden logic, PostAsyncAjax is just a functions that returns html...
function Load(ID) { CKEDITOR.instances['CkEditorTxt'].setData("", function () { PostAsyncAjax("GetData", { 'ID': ID}, function (data) { var Dto = data.d; CKEDITOR.instances['CkEditorTxt'].setData(Dto.HtmlContent); } ); }); return false; }
comment:4 Changed 11 years ago by
Asynchronously, I don't think it matters, Every time I debug it I can see that data.d does get html. Also when the bug happens ckeditor doesn't load any content - then I'm not able to type anything until I click view source button - if I do click it then content does loads.
comment:5 Changed 11 years ago by
It may not be crucial for your code, but it's crucial for CKEditor, because you call setData inside dataReady's listener - the correct timing is very important. Anyway, thanks for details, we'll verify it.
comment:6 Changed 11 years ago by
Just tested it with synchronously call and got same result - (ckeditor doesn't work). Thank you.
comment:7 Changed 11 years ago by
I'm able to reproduce it also with a very simplified snippet Repro:
- Page refresh
- open Chrome developer tool (F12) (if I use Chrome Version 30.0.1599.101 m then the bug happen without opening web developer tool.)
- execute function Load(ID)
function Load(ID) { $('#ckEditorDialog').dialog('open'); CKEDITOR.instances['CkEditorTxt'].setData("test"); return false; }
comment:8 Changed 11 years ago by
I don't have time to check this right now, but I think that your code is incorrect. When you open a dialog you need to initialize editor afterwards. I guess you use classic editor which uses an iframe - please note that iframe does not work if it's detached from DOM. So when you use CKEditor with dialogs you need to take special precautions against this problem - initialize editor when your dialog is open and destroy before closing it.
comment:9 Changed 10 years ago by
Resolution: | → expired |
---|---|
Status: | pending → closed |
Build config is attached