#javascript #oracle-apex #sweetalert
Вопрос:
Я создал DA, используя js-код SweetAlert, но когда я нажимаю кнопку отмена, другие действия в этом DA не останавливаются.
Это код, который я использую:
«
const swalWithBootstrapButtons = Swal.mixin({
customClass: {
confirmButton: 'btn btn-success',
cancelButton: 'btn btn-danger'
},
buttonsStyling: false
})
swalWithBootstrapButtons.fire({
title: 'Are you sure?',
text: "You won't be able to revert this!",
icon: 'warning',
showCancelButton: true,
confirmButtonText: 'Yes, delete it!',
cancelButtonText: 'No, cancel!',
reverseButtons: true
}).then((result) => {
if (result.isConfirmed) {
swalWithBootstrapButtons.fire(
'Deleted!',
'Your file has been deleted.',
'success'
)
} else if (
/* Read more about handling dismissals below */
result.dismiss === Swal.DismissReason.cancel
) {
swalWithBootstrapButtons.fire(
'Cancelled',
'Your imaginary file is safe :)',
'error'
)
}
})
«
Что мне нужно сделать, чтобы остановить действия при нажатии кнопки «Отмена»?
Заранее спасибо за всю вашу помощь.
Ответ №1:
Попробуй с apex.da.cancel
.
Узнайте больше по этой ссылке.
Комментарии:
1. Привет! Я уже пробовал это…все еще не работает. У вас есть еще какие-нибудь предложения?