我需要一些帮助来选择 GridView 中的单元格。我有一个这样的表:
<table>
<tr>
<th>CheckBox</th>
<th>Customer ID</th>
<th>First Name</th>
<th>Last Name</th>
</tr>
<tr>
<td>CheckBox</td>
<td>1</td>
<td>Joe</td>
<td>Blogs</td>
</tr>
<tr>
<td>CheckBox</td>
<td>2</td>
<td>Chris</td>
<td>White</td>
</tr>
</table>
我需要选择当前选中的行的 ID 单元格。你会怎么做?
我进行了搜索,但似乎找不到类似上述的内容。
最佳答案
$(":checkbox").click(function(){
if(this.checked){
var id = $(this).parent().next().text();
// assuming your second column has id you're looking for [customer id]
}
});
关于Jquery根据另一个单元格的状态检索单元格值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4387526/