Well, I have another solution regarding placing the contents of the editor in a div before dragging and dropping, and then after stopping it, return it to the editor. Thus, there is no need to create an editor instance after sorting.
$(function() { $( "#sortable" ).sortable({ start:function (event,ui) { //alert($('.attribute_text',ui.item).val()) $('.attribute_val',ui.item).html($('.attribute_text',ui.item).val()).show(); $('.attribute_div',ui.item).hide(); }, stop: function(event, ui) { $('.attribute_val',ui.item).hide(); $('.attribute_div',ui.item).show(); $('.attribute_text',ui.item).val($('.attribute_val',ui.item).html()); } }); $( "#sortable" ).disableSelection(); });
here attribute_text is the class name given by textara, which is dragged inside the sortable and is present inside .attribute_div attribute_val is the class name of the hidden element that is used to store the contents of the editor.
pradeep
source share