You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here you go, I haven't tested it but it should get you in the right direction. The following implements SweetAlert2 using the October CMS AJAX framework.
addEventListener('ajax:error-message',onErrorMessage);addEventListener('ajax:confirm-message',onConfirmMessage);functiononErrorMessage(event){const{ message }=event.detail;if(!message){return;}// Show sweet alertSwal.fire(message);// Prevent the default alert() messageevent.preventDefault();}functiononConfirmMessage(event){const{ message, promise }=event.detail;if(!message){return;}Swal.fire({title: "Are you sure?",text: message,icon: "warning",showCancelButton: true,confirmButtonColor: "#3085d6",cancelButtonColor: "#d33",confirmButtonText: "Confirm"}).then((result)=>{if(result.isConfirmed){promise.resolve();}else{promise.reject();}});// Prevent the default confirm() messageevent.preventDefault();}
More information on AJAX JS events can be found in the documentation:
Hy
Is it possible to override data-request-confirm to use sweetalert 'https://sweetalert2.github.io' instead of javascript alert ?
Thanks
The text was updated successfully, but these errors were encountered: