Search code examples
javascriptjquerydrag-and-droptinymce

TinyMCE editor content missing after drag and move


I've got a page with multiple TinyMce editors and i have drag and drop feature enabled which allows me to change the order of each items.

But as i drag-drop an editor its content gets removed.

See the screen shots :

Before Drag-Drop Before Drag-Drop

After Drag-Drop After Drag-Drop


Solution

  • Finally fixed the issue...

    The solution is to first shut down the tinymce instance (id needed!)

    tinymce.execCommand('mceRemoveControl',true,'editor_id');

    then do the DOM action and reinit the tinymce instance

    tinymce.execCommand('mceAddControl',true,'editor_id');