Bootbox Conform не показывает нажатие кнопки ссылки.Перепробовал так много всего, BootBox, Bootstrap и Jquery установлены в последнюю очередь.Кажется, после нажатия кнопки, диалоговое окно создается в верхней правой части нижней навигационной панели, потому что там значок мыши изменяется в 2 точках, но соответствующая модель или диалоговое окно не отображаются или не отображаются.Вот мой HTML-код:
<table id="customers" class="table table-bordered table-hover">
<thead>
<tr>
<th scope="col">Customers</th>
<th scope="col">Membership Type</th>
<th scope="col">Delete</th>
</tr>
</thead>
<tbody>
@foreach (var customer in Model)
{
<tr>
<td scope="row">@Html.ActionLink(customer.Name,"Edit","Customers",new { customer.Id },null)</td>
<td scope="row">@customer.MembershipType.Name</td>
<td scope="row"><button data-customer-id="@customer.Id" class="btn btn-link js-delete">Delete</button>
</tr>
}
</tbody>
</table>
Вот мой код Java Script:
@section scripts
{
<script>
$(document).ready(function () {
$("#customers .js-delete").on("click", function () {
//e.preventDefault();
var butten = $(this);
bootbox.alert("Are You sure You want to Delete this Customer?")
bootbox.confirm("Are You sure You want to Delete this Customer?", function (result) {
if (result) {
$.ajax({
url: "/api/customers/" + butten.attr("data-customer-id"),
method: "DELETE",
success: function () {
butten.parent("tr").remove();
}
});
}
});
//if (confirm("Are You sure You want to Delete this Csustomer?")) {
//}
});
});
</script>
}
Также, если я использую подтверждение по умолчанию вместо подтверждения загрузочной коробки, все работает нормально, но после нажатия кнопки удаления запись удаляется, но страница не обновляется.