views:

167

answers:

2

Basically I have a draggable list which is connected with a sortable list. Works great except I need some sort of Drop event which I can use to change the list item after its dropped into the sortable list.

This works with .draggable -> .droppable but is there a fix for draggable -> .sortable?

A: 

Figured out, turns out there is a receive event which is the same as drop for the droppable.

$('.selector').sortable({
  receive: function(event, ui) { ... }
});
mike
If I'm using the draggable with the helper: clone option is there a way to target the items I'm dropping. When I use the ui.item it changes the old item, while ui.helper doesn't seem to do anything.
mike
A: 

Why don't you use 2 sortable lists that are connected ? Then you can use the stop event

You can connect 2 lists by doing:

$("#sortable1, #sortable2").sortable({
        connectWith: '.connectedSortable'
}).disableSelection();

And then use the stop event

$( ".selector" ).sortable({
   stop: function(event, ui) { ... }
});

You can then change the dropped element by doing ui. (don't know this by heart but with the draggable plugin its ui.draggable)

Ojtwist