I have a simple application which creates a ckeditor instance with scayt autostartup configured to true. IE breaks when I reset the instance using setData. After searching for similar issues, I found that some folks have determined that the instance should be destroyed and replaced. When I do that, again configuring scayt autostartup to true, IE and Firefox give different errors, probably occurring from the same root problem, which indicate that the scayt widget is already activated. This goes away when I start it up with scayt autostartup configured to false (actually, simply omitted).
Short of simply not ever configuring it to true, any ideas on how to make scayt start up on the second instance? It does work, as shown below, in all browsers if I delete the scayt autostartup parameter.
Here are relevant code snippets:
Initial setup
Dialog box triggered by click on a "Cancel Changes" button (changes since last save):
ClearChanges function:
Short of simply not ever configuring it to true, any ideas on how to make scayt start up on the second instance? It does work, as shown below, in all browsers if I delete the scayt autostartup parameter.
Here are relevant code snippets:
Initial setup
var config = { toolbar : [...], ..., scayt_autoStartup : true }; $(".CKEditorRichTextEditor").each(function() { CKEDITOR.replace($(this).attr("id"), config); CKEDITOR.instances[$(this).attr("id")].on("instanceReady", function(e) { e.editor.dataProcessor.writer.indentationChars = ""; e.editor.dataProcessor.writer.lineBreakChars = ""; }); });
Dialog box triggered by click on a "Cancel Changes" button (changes since last save):
$("#GenericDialogBox").dialog( { title: "Cancel Changes to Your " + ChangeTargetName, modal: true, buttons: { Yes: function() { ClearChanges(SelectedFormElementsSet); $(this).dialog("close"); }, No: function() { $(this).dialog("close"); } } });
ClearChanges function:
function ClearChanges(SelectedFormElementsSet) { // Added this to fix IE break (caused below as commented) CKEDITOR.instances[$(".CKEditorRichTextEditor", SelectedFormElementsSet).attr("id")].destroy(true); CKEDITOR.replace($(".CKEditorRichTextEditor", SelectedFormElementsSet).attr("id"), config); CKEDITOR.instances[$(".CKEditorRichTextEditor", SelectedFormElementsSet).attr("id")].on("instanceReady", function(e) { e.editor.dataProcessor.writer.indentationChars = ""; e.editor.dataProcessor.writer.lineBreakChars = ""; }); // This is the code that originally caused IE to break CKEDITOR.instances[$(".CKEditorRichTextEditor", SelectedFormElementsSet).attr("id")].setData($(".AssessmentEntrySection", SelectedFormElementsSet).data("InitialTextValue"));
Re: scayt autostartup after destroy and replace doesn't work
Hello JackHerr,
The problem was recently reported to CKSource bug tracker - http://dev.ckeditor.com/ticket/9439.
WebSpellChecker.net team has found the reason for the problem and in progress preparing patch for scayt plug-in. The patch expected to be published within a week.
WebSpellChecker.net team