I ran into the same problem and fixed the answers to them. Please see the scripts below.
QUESTION: https://jsfiddle.net/33qt24L9/1/
$(function() { $( "#sortable" ).sortable({ placeholder: "ui-state-highlight" }); CKEDITOR.replace( 'editor1' ); CKEDITOR.replace( 'editor2' ); CKEDITOR.replace( 'editor3' ); CKEDITOR.replace( 'editor4' ); });
RESOLVED QUESTION: https://jsfiddle.net/57djq2bh/2/
$(function() { $( "#sortable" ).sortable({ placeholder: "ui-state-highlight", start: function (event, ui) { var id_textarea = ui.item.find(".ckeditor").attr("id"); CKEDITOR.instances[id_textarea].destroy(); }, stop: function (event, ui) { var id_textarea = ui.item.find(".ckeditor").attr("id"); CKEDITOR.replace(id_textarea); } }); CKEDITOR.replace( 'editor1' ); CKEDITOR.replace( 'editor2' ); CKEDITOR.replace( 'editor3' ); CKEDITOR.replace( 'editor4' ); });
EDIT: If I had separate configurations for each editor, the code was updated here to help:
start: function (event, ui) { $('.wysiwyg', ui.item).each(function(){ var tagId = $(this).attr('id'); var ckeClone = $(this).next('.cke').clone().addClass('cloned'); ckeConfigs[tagId] = CKEDITOR.instances[tagId].config; CKEDITOR.instances[tagId].destroy(); $(this).hide().after(ckeClone); }); }, stop: function(event, ui) {
Thanks: https://github.com/trsteel88/TrsteelCkeditorBundle/issues/53
source share