0
votes

when i click edit and edit the form i want reset the page background that is ajax page but when i click edit ، form is edited and close modal but not completely close modal

div ajaxshow is div on the layout that show ajax page on it

function OnSuccess(data) {
    if (data.status) {
        swal({
            title: "AAAAAAAAAAAAAAAAAA",
            type: "success",
            text: data.message,
            showConfirmButton: false,
            timer:1500
        })

        $('#myModal').modal('hide');
        $.ajax({
            url: "/Forces/Index/",
            type: "Get",
            datatype: "html"
        })
        .done(function (result) {
            $('#ajaxshow').html(result);
        })
    } else {
        swal({
            title: "ثبت شده",
            type:"warning",
            text: data.message,
            showConfirmButton: false,
            timer: 1500
        })
    }
}

Edit Form before click edit

after edit but close modal completely

1
The answer lies in understanding what swal() does to open a modal, then knowing what expression to use to close it properly. - Roamer-1888
what is problem ? - mahdi_elahitest
Only you know. I can't see inside swal(). - Roamer-1888

1 Answers

0
votes
function OnSuccess(data) {
    if (data.status) {
        swal({

            title: "AAAAAAAAAAAAAAAAAA",
            type: "success",
            text: data.message,
            showConfirmButton: false,
            timer:1500
        });

        $('#myModal').modal('hide');

        $.ajax({

            url: "/Forces/Index/",
            type: "Get",
            datatype: "html"
        })
        .done(function (result) {


            $('#ajaxshow').html(result);

        });


    } else {
        swal({

            title: "ثبت شده",
            type:"warning",
            text: data.message,
            showConfirmButton: false,
            timer: 1500
        });
    }
}