Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

draggable connectToSortable #86

Open
pyalot opened this issue Apr 20, 2013 · 6 comments
Open

draggable connectToSortable #86

pyalot opened this issue Apr 20, 2013 · 6 comments

Comments

@pyalot
Copy link

pyalot commented Apr 20, 2013

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.

@mjsarfatti
Copy link
Owner

Last time I checked it was a problem with Draggable itself, nothing I can do with the plugin :/

@pyalot
Copy link
Author

pyalot commented Apr 23, 2013

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.

@martijnmegens
Copy link

Same here, its so valuable to create a menu from a list of pages.

Is there maybe another route:

  1. Create 2 nestedSortables.
  2. Make one only 1 level, and let that one create copies, so original stays.

@mjsarfatti
Copy link
Owner

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...

@nkpz
Copy link

nkpz commented Nov 20, 2013

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.

@marcdebeer
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants