我正在向车把表显示一些数据。删除类别时,每行都有一个删除按钮,该类别始终从顶部删除。
我有一个模态,当我单击删除按钮时,模态打开以确认删除,如果单击“确认”按钮,则删除吗?
表格:
<table class="table table-striped table-sm bg-color-8 table-bordered table-responsive-sm mt-3">
<thead>
<tr>
<th>Title</th>
<th>Description</th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
{{# each category }} {{# each this}}
<tr>
<td>{{this.title}}</td>
<td>{{this.description}}</td>
<td>
<a href="/admin/dashbord/category/{{this.id}}/edit">
<i class="fa fa-pencil"></i>
</a>
</td>
<td>
<button data-toggle="modal" data-target="#myModal">
<i class="fa fa-trash-o" aria-hidden="true"></i>
</button>
</td>
<td>
<a href="/admin/dashbord/category/{{this.id}}/view">
<i class="fa fa-eye"></i>
</a>
</td>
<div class="modal fade" id="myModal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Confirm Delete</h4>
<button type="button" class="close" data-dismiss="modal">×</button>
</div>
<div class="modal-header">
Are you sure you want to delete the entry?
</div>
<div class="modal-footer">
<a href="/admin/dashbord/category/{{this.id}}/delete" class="btn btn-danger">yes</a>
</div>
</div>
</div>
</div>
</tr>
{{/each}} {{/each}}
</tbody>
</table>
如何修复它。 谢谢。