tags:

views:

57

answers:

2

Ok, I have a table which contains multiple rows. Each row contains some data and a hyperlink. When this link is clicked, I need to open up jquery's dialog form and let the user able to edit the data of the corresponding rows. So when the link is clicked, I need to access the values of the corresponding row cells from jquery.

How can I do that ?

+2  A: 

Basic structure:

$("#tableId a").click(function() {
  var row = $(this).closest("tr");
  ...
  return false;
});

Inside that you can then access cells most easily by giving marker classes to your cells and then doing things like:

var total = row.children("td.total");

assuming a class of total.

cletus
+1  A: 

cletus is right... but if you're just up to editing data cell, might as well use Jeditable

Reigel