I have a situation where I want to make a container both Droppable and Sortable at the same time. The use case is, you drag a button into the Droppable container, and when you do so the onDrop callback creates an HTML node and inserts it into the container. I also want those objects to be Sortable, so that I can reorder them after I have dropped them into the container.
But if I make the container Droppable first and then Sortable, then it doesn't quite work. When I initialize the containers as Sortable, it first makes the "accept" elements Draggable, and then tries to make the container Droppable. But, since I have already made it Droppable, the Sortable code sees this and skips it. Thus the Droppable still works, and the "accept" elements are draggable, but I can't drop them anywhere, so they always just revert to where they originated from.
If I do it the other way around, make the container Sortable and then Droppable then the opposite is true. The elements are sortable, but nothing happens when I drop something in the container.
I was wondering if anyone else has seen this problem, and if so if they have a workaround or solution. I tried adding an onDrop as a Sortables configuration parameter, and then appending the method that is passed in after the default onDrop that Sortables adds to the container. That was moderately successful, but then I ran into more issues, because it still tried to sort. I added a cancelling mechanism, but there were more issues with that. You can see where this is going...
Any suggestions on this issue would be greatly appreciated.
Thanks,
Brendan O'Brien
_______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/