Skip to content

Instantly share code, notes, and snippets.

@dealingwith
Created October 15, 2012 02:00
Show Gist options
  • Save dealingwith/3890461 to your computer and use it in GitHub Desktop.
Save dealingwith/3890461 to your computer and use it in GitHub Desktop.
// be able to sort show list
$("#showlist_list").sortable();
// reapply zebra striping to show list after resorting
$("#showlist_list").bind("sortupdate", function(event, ui) {
// construct order array
var sort_array = [];
$("#showlist_list li").each(function(){
var id = $(this).attr("id").split("_")[1];
sort_array.push(id);
});
// update model
showModel.sortModel(sort_array);
showModel.save();
addZebraStripes("#showlist_list li");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment