【发布时间】:2016-04-06 05:05:35
【问题描述】:
我希望每个表格行中除了最后一个 <td> 元素之外的所有元素都是一个可点击单元。
这是我所拥有的:
<table class="table table-bordered" id="dashboard-table">
<thead>
<tr>
<th>Open Date</th>
<th>Name</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
@for(ach_case <- caseList) {
<tr>
<div class="clickable-row">
<td>@ach_case.formatDate(ach_case.dateCreated)</td>
<td>@ach_case.name</td>
</div>
<td>
<button type="button" class="btn-warning btn-action"
onclick="window.location='@routes.CaseController.editCase(ach_case.id)';"></button>
</td>
</tr>
}
</tbody>
</table>
jQuery
$(document).ready(function(){
$('.clickable-row').click(function() {
console.log("Row clicked");
});
});
这没有任何作用。我很累,所以希望这只是一个简单的问题。
【问题讨论】:
-
在选择器中尝试 tr .clickable-row
标签: javascript jquery html playframework