You can't cancel the drop it seems. Only solution I have so far is to redraw the all the draggables...
This is for applying a confirmation dialog to the drop and goes something like:
fruitbowl.draw() // my routine which puts draggable elements into the DOM
$("trash").droppable({
drop: function(ev, ui){
$("#areyousure-dialog")
.data('fruit',ui.draggable) // passes the dragged el
.dialog("open")
}
}
$("#areyousure-dialog").dialog({
buttons: {
'Yes I\'m sure': function(){
var fruit = $(this).data('fruit')
fruit.remove()
fruitbowl.draw()
$(this).removeData('fruit').dialog('close')
},
Cancel: function(){
fruitbowl.draw()
$(this).removeData('fruit').dialog('close')
}
}
Open to improvements, not sure if that's the best way to pass the dropped element to the dialog, but works for me.