I have code as follows:
$(".assigned_draggable, .unassigned_draggable").draggable({
helper: function(){ return $(this).clone().css('border',
'1px solid red').css('background-color', '#DDD')},
opacity: .75,
start: function(e, ui){ }
});
$("#unassigned").droppable({
accept: ".assigned_draggable",
activeClass: 'droppable-active',
hoverClass: 'droppable-hover',
drop: function(ev, ui) {
ui.draggable.removeClass("assigned_draggable").addClass("unassigned_draggable");
$(this).append(ui.draggable);
campaign_id = ui.draggable.attr('id').split('_')[2];
username= ui.draggable.attr('id').split('_')[1];
$.ajax({
url: "/admin/stuff/destroy",
type: "DELETE",
data: "stuff_id=" + stuff_id + "&username=" + username,
dataType: 'script',
error: ajaxFail
});
}
});
How would I go about reverting the draggable to its original position
if the ajax request returns with an error? I am pretty new to jQuery
so maybe I am missing something.
Thanks,
Christian
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---