小编S.z*_*aid的帖子

SweetAlert2 取消按钮无法正常工作

我的SweetAlert2 中有一个 Yes 和 No 按钮。当我单击“否”时,它会发布一个方法,但我只希望它关闭 SweetAlert。

这是我写的代码:

   $('.js-update-details-click').click(function () {

        var Id = Number($(this).data('result-id'));

        swal({
            title: 'Are you sure you want to ask the User to update their details?',
            type: 'warning',
            showCancelButton: true,
            closeOnConfirm: false,
            confirmButtonColor: '#3085d6',
            cancelButtonColor: '#d33',
            confirmButtonText: 'Yes',
            cancelButtonText: 'No',
            confirmButtonClass: 'btn btn-success btn-full-width mar-bot-5',
            cancelButtonClass: 'btn btn-danger btn-full-width mar-bot-5',
            buttonsStyling: false
        })
            .then(function (isconfirm) {
                if (isconfirm) {
                    $.ajax({
                        type: "POST",
                        url: '/Common/ComposeUpdateDetailsEmail',
                        data: { ReplyType: 'CleanUpdateDetails', Id: Id },
                        success: function (data) …
Run Code Online (Sandbox Code Playgroud)

sweetalert sweetalert2

2
推荐指数
1
解决办法
7831
查看次数

标签 统计

sweetalert ×1

sweetalert2 ×1