开发者

2 alert boxes on jquery-ui-sortable update?

开发者 https://www.devze.com 2023-02-12 16:15 出处:网络
开发者_如何学JAVAWhy I am getting 2 alert messages when I change the order of the html sortable div tags?
开发者_如何学JAVA

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?

0

精彩评论

暂无评论...
验证码 换一张
取 消