I have use this code for delete record with sweet aleart .It's not working with sweet aleart and without sweet aleart it's working .please help me.
- $(document).ready(function () {
- $("#Report").on('click', '.btndelete', function () {
- swal({
- title: "Confirmation?",
- text: "Are you sure you want to delete record?",
- type: "warning",
- confirmButtonClass: "btn-danger",
- showCancelButton: true,
- confirmButtonText: "Yes,Please Delete it!",
- closeOnConfirm: false
- }, function () {
- swal("Deleted!", "Data has been successfully deleted.", "success");
- });
- var ab = $(this).closest('#item');
- ab.remove();
- var id = $(this).attr('id');
- $.ajax({
- url: "DeleteReport",
- type: "POST",
- data: { "ContactUsId": id },
- success: function (data) {
- if (data.status == true) {
- $(this).closest('#item').remove();
- }
- else {
- alert("Something went wrong");
- return false;
- }
- },
- error: function (er) {
- alert(er);
- return false;
- }
- });
- });
- });

Jenith ThakkarRank #789 · 2.9K reputationPosted Sep 2, 2020, 7:08 AM EDT
if it has a true value then call delete function else return without calling
Thank you
Laxmidhar SahooRank #383 · 6.6K reputationPosted Sep 2, 2020, 3:14 AM EDT
Laxmidhar SahooRank #383 · 6.6K reputationPosted Sep 2, 2020, 3:25 AM EDT
Posted Sep 2, 2020, 3:22 AM EDT
Posted Sep 2, 2020, 4:21 AM EDT
Hamid KhanRank #424 · 5.9K reputationPosted Sep 4, 2020, 9:15 AM EDT