jquery - Is there a sortable event for "updated but not removed"? -
i have 2 connected lists
$('#list1').sortable({ update: function(event, ui){ //some code shouldn't executed when element removed }, remove: function(event, ui){ //some code } }); $('#list2').sortable({ });
i action when list reordered (update triggered), , action when element of list in removed (but update triggered in case).
haven't tested should work:
var delete = false; $('#list1').sortable({ update: function(event, ui){ if (delete === true) { delete = false; return false; } //some code shouldn't executed when element removed }, remove: function(event, ui){ delete = true; //some code } });
set flag when deleting something, when deleting finishes update process starts , if flag true skip updating , reset flag.
Comments
Post a Comment