I have a function that deletes row like this:
function DeletePublisher(element, publisherid) {
jConfirm('Are you sure you want to delete this publisher?', 'Delete publisher', function (r) {
if (r) $.post('includes/publishers/delete-publisher.php?publisherid=' + publisherid,
function(data) {
if ($.trim(data) == 'error') {
$.jGrowl('This publisher was already deleted', { header: '<strong style="text-align:center;">ERROR</strong>' });
$(element).parents('tr').remove();
} else {
$(element).parents('tr').remove();
$.jGrowl('Publisher deleted');
}
});
});
Now this works perfectly, but after row is deleted other rows are not updated classes (odd and even classes). So after I delete a row (in this example second TR is deleted:
<tr class="odd">
<tr class="even">
<tr class="odd">
<tr class="even">
I am getting it like this:
<tr class="odd">
<tr class="odd">
<tr class="even">
Now I am not sure if this is my error or I am missing something ?