Tablesorter breaks when removing row and using pager
If I use remove() instead of hide(), or if I use trigger('update'), the pager drops all pages except the current one. I'd like to use remove(), and ideally the a row that is deleted would be replaced by one from the next page. I thought that trigger('update') was supposed to do that for me. Any advice?
- $(document).ready(function(){
$("#myTable").tablesorter({
widgets: ['zebra'],
headers: {
0: { sorter: false }
}
}).tablesorterPager({
container: $("#pager")
});
$('.delete-img').live('click', function(){
var answer = confirm('Delete: ' + $(this).parent().next().html() + '?');
if(answer){
// using remove() instead of hide() breaks the pagination after a row has been removed and a column is sorted
$(this).closest('tr').hide();
// this breaks the pagination after a row has been removed and a column is sorted, even with hide()
//$("#myTable").trigger("update");
}else{
alert($(this).closest('tr').attr('id') + ' was not deleted');
}
});
});