Hi. I am trying to add a function that, when a user clicks "remove",
1) updates the numbers in the left-most column 2) updates the id order 3) updates the alternating color scheme
I need help with
1) I am able to update the number row but it currently updates for all rows, even if there isn't anything there. Can somebody show me how to do this only for the populated rows? For example, stop when a given row doesn't have data.
2) Something is wrong with my logic for updating all ids for a given row. What I am trying to do is replace the number at the end of the id name ("numRow11", for example) with the corresponding row number.
$('#files_list tr').each(function(index) {
// update number order
$(this).find("td:first").text(index+1);
$(this).find("td").attr('id', $(this).attr('id').replace($(this).attr('id').match(/[\d\.]+/g), index));
if (index % 2 == 0)
$(this).removeClass().addClass('evenRow');
else
$(this).removeClass().addClass('oddRow');
});