How to implement TinyMCE table drag and drop table?

In tinyMCE, you can use the table plugin to insert tables, and that's fine. Now, when it comes to moving a table in your content, it's a little more complicated.

The right way to do this at the moment is to "select the entire table" and "drag it where you want."

This is a bit clumsy, and in real life, users are likely to skip a bit of their table in the selection, and dragging and dropping this unbiased selection will completely destroy the table.

The correct solution to this problem is probably to implement a kind of “handle” on top of the table or something that users can grab / drag / delete to safely move the entire table at once.

Any idea on how to implement such a nice thing?

+5
source share
1 answer

You have to put this functionality in your own plugin, and if the draggesture event is fired, you will check what the user typed. If his selection contains part of a table, you replace the contents of the drag with the full table.

+4
source

All Articles