angular-skyhook icon indicating copy to clipboard operation
angular-skyhook copied to clipboard

Multiple Drag and Drop

Open tk2232 opened this issue 5 years ago • 3 comments

Is it possible to add an example for multiple drag and drop. Select multiple items and drag them together. I have no idea how to implement that.

tk2232 avatar Jan 08 '20 08:01 tk2232

Trick is you can’t actually have more than one skyhook drag source dragged at once, so you have to simulate it by having a complex drag preview that looks like it has picked up multiple items. If you feed the preview a list of items that were ticked just prior to dragging the last item, it could render a stack, a number (7 items) or even a bunch of little previews scaled from their original positions. You just need to write the tick selection mechanism. (Shift clicking events caught with mousetrap.js would also work and be easier to cancel.)

cormacrelf avatar Jan 09 '20 04:01 cormacrelf

I tried a few solutions, but none that worked properly. Multisort is not the problem. I have difficulties with the preview and I have no idea how to connect this list with another list. Is there no dragTarget in angular-skyhook/sortable?

https://stackblitz.com/edit/angular-skyhook-select-drag-preview?embed=1&file=src/app/simple/simple.component.ts

tk2232 avatar Jan 10 '20 07:01 tk2232

Here is example of working preview for multi selection. It was done for agGrid but idea should be similar.

olexme avatar Feb 03 '20 15:02 olexme