The plugin api is always a good reference, in your case specifically in the events part.
For this, it depends a little on the context, it has 3 events, stop()
, update()
and receive()
.
The stop()
is fired whenever you, of course, stop dragging the element.
While update()
is very similar, but fires only if there is a change of position.
The% w / w that I think is the right one for you, is triggered when you drop an element from another list connected to the source list.
The code is very simple:
$(function() {
$("#sortable1, #sortable2, #sortable3, #sortable4, #sortable5, #sortable6").sortable({
connectWith: ".connectedSortable",
update: function (event, ui) {
alert('Arrastado com sucesso com alteração.')
},
stop: function(event, ui) {
alert('Arrastado com sucesso, mesma posição.')
},
receive: function(event, ui) {
alert('Arrastado com sucesso para outra lista.')
},
}).disableSelection();
});
Now just decide which is best for you.