of course jquery magic can be used! just name your cells what they are and include a hidden field with the id, for instance:
<tr>
<td class="firstname"><input /></td>
<td class="lastname"><input /></td>
<td class="address"><input /></td>
<td class="phone"><input /></td>
...
<td class="whatever">
<input />
<input type="hidden" class="itemId" value="[the id]" />
</td>
</tr>
when you want to update a certain row, grab the row by doing something like
var row = $('tr').find('.itemId[value=' + id + ']');
// if you're in an event handler:
var id = $(this).parents('tr').find('.itemId').val(); //gets you the id you want
now you can do things like:
var firstname = row.find('.firstname :input').val(); //etc..
compile them into a JSON object:
var data = {"itemId": id, "firstname": firstname, "lastname": lastname, ...etc };
and submit via $.post()
, $.ajax()
or $.get()
. Easy!