JQuery Draggable + Sortable: how to determine if an item has really been added to my sortable list?

Well, I probably missed something obvious here, but my searches do not help anything. I created a sortable list and attached a shuffled "palette list" to it, as described here: http://jqueryui.com/demos/draggable/#sortable

I can drag and drop items from my drag-and-drop list and put them in my sorted list. It works great.

I need to run the function only when one of these elements is deleted on the sortable one.

I tried the "stop" hook on the draggable element, but it fires regardless of where the element fell (it fires if it returns: "invalid" starts, for example). I cannot find any properties anywhere to tell me whether the drag was successful or not.

I tried treating sortable as "droppable" and binding to "drop", but that didn't even get called.

Thanks for the help!

+1
source share
1 answer

Found it!

Sort has an event called receive. http://api.jqueryui.com/sortable/#event-receive

As I missed this in the last few hours after digging, she married me.

+2
source

All Articles