2 alert boxes on jquery-ui-sortable update?
Why I am getting 2 alert messages when I change the order of the html sortable div tags?
http://jsfiddle.net/oshirowanen/QgqRV/1/
I would have thought the following line in the link above would have given 1 alert message?
update: function(event, ui) { alert("test"); }
You have this in your code
update: function(event, ui) { alert("test"); }
You've bound an alert method to the update event of the sortable
EDIT
And if you're question is why you're getting 2 alert boxes and not just 1, it's because the update event fires for all sortable items that were changed. So including the one you dragged, and any others that had to shift position to accommodate it.
2 columns are updating, because you're moving a sortable between columns.
If you move a sortable around in its original column it only triggers one alert.
maybe you want the receive or remove events?
精彩评论