Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to implement a TinyMCE Table Drag Handle?

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

The correct way of doing it at the moment is to 'select the whole table' and 'drag it to where you want'.

This is a bit clunky and real-life users are most likely to miss a bit of their table in the selection, and dragging this impartial selection will completely break 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 could grab/drag/drop to securely move the whole table at once.

Any idea of how to implement such a nice thing?

like image 600
jeje Avatar asked Oct 10 '22 15:10

jeje


1 Answers

You should put this functionality in an own plugin and if the draggesture event gets fired you check what the user has grabed. If his selection contains a part of the table you replace the drag content with the full table.

like image 176
Thariama Avatar answered Oct 13 '22 10:10

Thariama