
Untitled
By: a guest on
Apr 26th, 2012 | syntax:
None | size: 1.71 KB | hits: 16 | expires: Never
jquery how to select the nth-child of the current TD in a dynamic table
$('.notdupe').live('click', function (e) {
//alert("indivNum=" + $(e.target).val() + "&SetValue=" + $(e.target).is(":checked"));
$.ajax({
type: "POST",
url: "cfc/basic.cfc?method=SetNotDupe",
data: "indivNum=" + $(e.target).val() + "&SetValue=" + $(e.target).is(":checked"),
error: function (xhr, textStatus, errorThrown) {
// show error alert(errorThrown);
}
});
alert($(e.target:nth-child(-10)).css);
});
<td class="dupegroup">#dupe_group_number#</td>
<td><input type="checkbox" name="UserIDList" value="#userid#" /></td>
<td><a href="#request.controlURL#individuals/?fa=viewIndiv" target="_blank">#userid</td>
<td>#lastname#</td>
<td>#firstname#</td>
<td>#nickname#</td>
<td>#companyname#</td>
<td>#address1#</td>
<td>#zipcode#</td>
<td>#state#</td>
<td>client</td>
<td align="center"><input class="notdupe" type="checkbox" name="indivID" value="#userid#" checked /></td>
$firstTD = $(this).parent().siblings().first()
$(this).closest('tr').find('td:first')
$('.notdupe').live('click', function (e) {
//alert("indivNum=" + $(e.target).val() + "&SetValue=" + $(e.target).is(":checked"));
$.ajax({
type: "POST",
url: "cfc/basic.cfc?method=SetNotDupe",
data: "indivNum=" + $(e.target).val() + "&SetValue=" + $(e.target).is(":checked"),
error: function (xhr, textStatus, errorThrown) {
// show error alert(errorThrown);
}
});
alert($(this).closest('tr').find('td:first').text());
});
$td_you_want = $(this).closest('tr').children('td').first();