draggable connectToSortable
I'd like to connect draggables to the nestedSortable. There is a draggable option for that http://api.jqueryui.com/draggable/#option-connectToSortable
That option doesn't work currently.
Last time I checked it was a problem with Draggable itself, nothing I can do with the plugin :/
Can you describe your findings as to why it doesn't work? I'll need to get this fixed eventually, and I'm wondering if a workaround is possible, or if I have to submit a bug ticket for jQuery UI.
Same here, its so valuable to create a menu from a list of pages.
Is there maybe another route:
- Create 2 nestedSortables.
- Make one only 1 level, and let that one create copies, so original stays.
It was a problem with the events triggered on start. NestedSortable wasn't able to properly receive the element. I really don't remember the details though :| Things might have changed now though...
If you're interested in doing this, take a look at the definition of connectToSortable here: https://code.google.com/p/jquery-ui/source/browse/trunk/ui/ui.draggable.js?r=3103#452 As you can see, it's reading the data property "sortable" , which is why it isn't compatible. nestedSortable instead uses the property "mjsNestedSortable" (may be different depending on the version you're using)
You can basically copy this whole plugin.add block, rename connectToSortable to connectToNestedSortable, and alter it to check for the correct data attribute.. then you've successfully extended draggables to support nestedSortable. Just had to do it myself and it's working pretty well.
Would you be so kind as to provide us this working example nnjpp? I understand what you're explaining but I just can't seem to get it working from my side. Alternatively, is there a more concrete fix for this?