Sortable icon indicating copy to clipboard operation
Sortable copied to clipboard

Draggable option recursive

Open maxime-gerum opened this issue 9 years ago • 3 comments

Hello and thank you for your project,

I work with detailled tree but 'draggable' option seems to not be 'recursive'

I've made a Fiddle : https://jsfiddle.net/ymteftma/2/

First example work but not the others

I forgot something ?

Regards, Maxime.

maxime-gerum avatar Apr 13 '17 13:04 maxime-gerum

hello,

I forked your code and provided some a potential solution. I'm not sure its the best solution, but it works.

https://jsfiddle.net/p7t41d53/1/

I think wrapping each 'item' you want to be draggable in a div could help achieve what you are looking for. I'm not sure why this wouldn't work with list items, but it appears to work OK with divs.

I wasn't entirely sure what you wanted to be 'recursive', so I made two examples.

"listWithHandle3" has each item draggable, even "third"

"listWithHandle4" keeps "third" nested as a child of "Second"

aintJoshinya avatar Apr 13 '17 13:04 aintJoshinya

Hello aintJoshinya,

The third example is what i want, but i work with large items lists with potentially 5-10 steps it's just not possible for me to implement this solution.

Thank you for your help

maxime-gerum avatar Apr 13 '17 13:04 maxime-gerum

@maxime-gerum Draggable elements must be direct children of the sortable. @aintJoshinya's solution is the best way.

owen-m1 avatar Dec 30 '18 17:12 owen-m1