[jQuery] Need a little assistance mapping event source to AJAX callbacks
I have a decent amount of JQuery success under my belt at this point
but I am in need of some page / request architecture help.
I have a table of user data, one row per user. Each row has a 'change
role' button wired up with a click handler that makes an ajax ($.ajax)
post to a webservice. Response times are 3-5 seconds, but the general
goal is to let the user move onto other rows in the table and trigger
the same event for a different record. Assume that the responses from
the webservice are generic and do not identify the record affected by
the request.
My problem is figuring out how I correlate the success or error
callbacks with the table row from which the event originated (to
remove the activity indicator or report an error). I'm blind to
finding a way to pass additional data such a row DOM reference (not
request related data) through to the success or error callbacks.
Could one of you talented folks illuminate the path for me or
otherwise correct my thinking / approach?
With great appreciation for your time,
Mark