开发者

JQuery - Ajax saving sortables in connected lists when sortable item is moved

I have multiple JQuery sortable lists that connect with each other... They allow you to assign users to certain roles.

Basically what I want to do is when a user is dragged from one list to another, I want JQuery to pick up the first list that the user was moved from so that I can send an AJAX request to delete it from that list in my database.

I tried the following but 开发者_高级运维every time you move the user over a list and haven't even dropped it within a list, it sends this request which means I'll be sending multiple AJAX requests... Does that make sense?

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

From my testing, I can use the following code to just update the list that user has been moved to so I've got the second half covered:

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

Hopefully I am making sense :)


you might try out the update and receive-event.
otherwise JRTFM

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜