I want to detach a row from a table after a button is clicked. However, I cannot manage to append it back to where it was. I ended up with the code below to detach the row that the “delete” button belongs to:
$(".removeTR").live('click', function (event) {
$(this).closest('tr').fadeTo(400, 0, function () {
$(this).detach();
});
return false;
});
The problem gets more complicated when I need to detach more than one row and then append them all with a “reset” button. Can you please make any suggestions or direct me to the proper logic?
I managed to make it work exactly the way I wanted utilizing show() and hide(). This way I didn’t have to worry about positioning. However I have concerns over the performance when dealing with a huge number of table rows.
You can see my working example below: http://jsfiddle.net/YCdGQ/51/