1
私はthymeleafに新規です。tr
のIDを作成し、動的行を取得しようとしています。Thymeleaf-テーブル行の動的IDを作成
テーブルの行は正常に取得されましたが、thymeleafの各行のidを作成するのは難しいです。
<table class="table table-hover" id="table">
<thead style="background-color:#CCE5FF">
<tr>
<th>ID</th>
<th>Code</th>
<th>Created Date</th>
<th></th>
</tr>
</thead>
<tbody>
<tr th:each="emp,iterStat : ${empList}">
<td th:text="${emp.id}">ID</td>
<td th:text="${emp.mdrcode}">Code</td>
<td th:text="${emp.createDate}">Created Date</td>
<td><a id="editview" class="btn btn-sm btn-default" th:href="@{/}"><i class="fa fa-edit"></i> View</a></td>
</tr>
</tbody>
</table>
それがうまく働いていただきありがとうございます。しかし、これを表示する可能性は、jqueryを使用して警告ボックスに表示されますか? – Durga
これらの 'tr'タグにクラスを追加してクリックリスナーを追加し、' .attr( 'id') ' –