ボタンが選択されている場合、行のテーブルデータを取得する際に問題が発生します。承認と拒否の2つのボタンがあり、ユーザーがクリックしたボタンに基づいて、クエリを使用してデータを取得します。行データだけでなく、行番号などを取得できます。IDとテスターを取得する必要があります。
これが私が持っているものです
<table id="mytable" width="100%">
<thead>
<tr>
<th>ID</th>
<th>Tester</th>
<th>Date</th>
<th>Approve</th>
<th>Deny</th>
</tr>
</thead>
<tbody>
<tr class="test">
<td class="ids">11565 </td>
<td class="tester">james</td>
<td>2012-07-02 </td>
<td><Button id="Approved" type="submit" >Approved</button>
</td>
<td><Button id="deny_0" type="submit" >Denied</button>
</td>
</tr>
</tbody>
</table>
これがtrとtdの番号を取得するためのJavaScriptですが、必要なものを取得するためにそれを使用する方法がわかりません
$(document).ready(function() {
/*$('#cardsData .giftcardaccount_id').each(function(){
alert($(this).html());
}); */
$('td').click(function(){
var col = $(this).parent().children().index($(this));
var row = $(this).parent().parent().children().index($(this).parent());
alert('Row: ' + row + ', Column: ' + col);
// alert($tds.eq(0).text());
console.log($("tr:eq(1)"));
// $("td:eq(0)", this).text(),
});
});