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

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

IIS->Tomcat Redirect: multiple worker with default -