To plugin api is always a good reference, in your case specifically in the event part.
For this, depends a little bit on the context, has 3 events, stop()
, update()
and receive()
.
The stop()
and fired whenever you obviously stop dragging the element.
Already the update()
is quite similar, but fires only if there is a change of position.
The receive()
which I think is ideal for you, is fired when you drop an element in another list connected with the source.
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.
Got it, the idea, is I call a loading, and update in the database and give an append of the new list...
– Sr. André Baill