[jQuery] Row editing/deletion: Best Practices

[jQuery] Row editing/deletion: Best Practices


Hello,
I'm creating a form to handle row editing and deletion via AJAX calls.
What's the best way to handle edit and delete events The jQuery Way
when viewing a list of items? Specifically, how do I identify which
row is being operated upon without embedding an id value somewhere?
If I aim for the ideal of "unobtrusive javascript," then I'm going to
assign a click event to my elements in ready(). However, I need to
pass the database row id (for example, employee_id) for my AJAX calls.
How should I do this?
My HTML template just loops on a query result set and outputs "li" or
"tr" tags, and could just surround my data with "a" tags with
attribute "href=#" and a direct link to a javascript function with a
row id in the click event, but that doesn't seem to agree with the
"unobtrusive" approach.
The last post in the following thread provides an example of a
possible solution:
http://groups.google.com/group/jquery-en/tree/browse_frm/thread/bdea60d941e4945f/04d20fbd9b8eaa95
However, this example uses a javascript data structure, and relies on
this structure to fetch ids. In practice this wouldn't occur, because
the data set would be output from a server script. The server script
could output the structure in javascript, but this duplication
wouldn't be clean or efficient.
So the ideal here is basically 1) outputting data rows from a server,
2) assigning client-side events to the rows _unobtrusively_, 3)
passing server-side ids from the client-side code in AJAX calls. How
is this best accomplished?