sweet-alert
sweet-alert copied to clipboard
Confirm before deletion
I am using Laravel 6.5 with sweet alert's 2.0.3 version
I want to know that, how to display the confirm button before the deletion of data? If user press yes delete it it should be deleted otherwise it shouldn't be deleted
Duplicate #17
Hey @realrashid how are you? Did you added this feature in your new release? If so then please let me know
Hello @realrashid , have you added it?
Hey, Now i am free and i will give time to add this feature to this package. 🎉
Thanks a lot @realrashid :)
@realrashid, well done. Please we still await this update. Regards
@realrashid bro will this feature available in next update?
I still need to write some dynamic code to make this function flexible. If you can share how you are doing in the moment this really help me to write simple helper functions.
Please Share to at [email protected].
Thanks for your support. :heart:
@realrashid Any news about this feature?
I saw you closed it but Still wondering how do you handle delete confirmation ? I couldn't find any proper answer. we need to delete and confirm from controller ?
any new sugguestions to how to handled confirmation from the blade before sending the request to the controller
Hey Guys..
Please checkout https://dev.to/realrashid/how-to-use-sweetalert2-with-livewire-56i6 this.
Thanks
In Live Wire there is a Custom coded JS confirmation box which can still be used in Blade component with Custom coding.... But can you please include it into your package so we dont have to use custom coding?
@realrashid
guys, if you want to show confirm button before deleting a data in your blade file you can add this script:
Swal.fire({
title: 'Yakin ingin menghapus data?',
text: "You won't be able to revert this !",
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, delete it!'
}).then((result) => {
if (result.isConfirmed) {
$(`[data-penguji=${id_penguji}]`).parents('.raised.card').remove()
}
})
any update?
It's not added yet..
On Sun, Mar 20, 2022, 10:10 AM hiprm @.***> wrote:
any update?
— Reply to this email directly, view it on GitHub https://github.com/realrashid/sweet-alert/issues/57#issuecomment-1073169943, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADXCPBJHM6VD5XFBIHXYQQTVA2XMJANCNFSM4JK5UZYQ . You are receiving this because you were mentioned.Message ID: @.***>
guys, if you want to show confirm button before deleting a data in your blade file you can add this script:
Swal.fire({ title: 'Yakin ingin menghapus data?', text: "You won't be able to revert this !", icon: 'warning', showCancelButton: true, confirmButtonColor: '#3085d6', cancelButtonColor: '#d33', confirmButtonText: 'Yes, delete it!' }).then((result) => { if (result.isConfirmed) { $(`[data-penguji=${id_penguji}]`).parents('.raised.card').remove() } })
That is not a good solution, because the Swal is not defined on the page if there wasn't other alert before. This is only works with the SWEET_ALERT_ALWAYS_LOAD_JS=true .env variable.