how to update Sr. No. COLUMN after removing a TR from TABLE

Posted by user251336 on Stack Overflow See other posts from Stack Overflow or by user251336
Published on 2010-01-15T06:56:09Z Indexed on 2010/04/03 21:03 UTC
Read the original article Hit count: 388

Filed under:
|

i have a table like

<table>
<tr>
    <td>Sr. No.</td>
    <td> Name</td> 
    <td>$nbsp;</td>
</tr>
<tr>
    <td>1</td>
    <td>abc</td>
    <td>remove button</td>

</tr>
<tr>
    <td>2</td>
    <td>xyz</td>
    <td>remove button</td>
</tr>
<tr>
    <td>3</td>
    <td>def</td>
    <td>remove button</td>
</tr>

onclick of ' remove button ' i send ajax request & after successful response i remove the respective TR using $('#id_of_tr').remove();.

till here everything goes fine but now i want to update Sr. No.s of each row. Because Initially order is 1 2 3 , when i remove second row then it becames 1 3 which i want to update it to 1 2.

I hope this would help.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about JavaScript