gpt4 book ai didi

javascript - 如何隐藏 bootbox.js 模态

转载 作者:行者123 更新时间:2023-11-30 06:50:39 24 4
gpt4 key购买 nike

我想隐藏我所有的 bootbox模态。我目前有 2 个模态框,在单击“取消”后,我想隐藏所有其他模态框。

这是我的代码:

$('#table-grid').delegate(".requestBill", "click", function () { // store the checked checkbox ticket_id into array 
const prop_id = $(this).data('prop_id');
bootbox.prompt({
title: "Request Bill",
inputType: 'textarea',
placeholder: 'Enter Additional Message',
value: 'I am requesting an RPT Bill.',
buttons: {
confirm: {
label: 'Submit'
},
cancel: {
label: 'Cancel',


}
},
callback: function (result) {
if (result == null) {
$.toast({
heading: 'Note',
text: 'Cannot request bill without describing reason(s)',
icon: 'error',
loader: false,
stack: false,
position: 'top-center',
allowToastClose: false,
bgColor: '#f0ad4e',
textColor: 'white',
});
} else if (result == "") {
$.toast({
heading: 'Note',
text: 'Cannot request bill without describing reason(s)',
icon: 'error',
loader: false,
stack: false,
position: 'top-center',
allowToastClose: false,
bgColor: '#f0ad4e',
textColor: 'white',
});


} else {
var fd = new FormData();
fd.append("prop_id", prop_id);
fd.append("content", result);
$.ajax({
type: "POST",
url: base_url + "Main_declaration/request_bill",
data: fd,
contentType: false,
cache: false,
processData: false,
beforeSend: function () {
$(".requestBill").attr('disabled', true)
},
success: function (data) {
if (data.success == 1) {
$.toast({
heading: 'Success',
text: data.message,
icon: 'success',
loader: true,
stack: false,
position: 'top-center',
allowToastClose: false,
bgColor: '#5cb85c',
textColor: 'white',
});
} else {
$.toast({
heading: 'Note',
text: data.message,
icon: 'error',
loader: false,
stack: false,
position: 'top-center',
allowToastClose: false,
bgColor: '#f0ad4e',
textColor: 'white',
});
}
}
});
}
}
});

});

隐藏引导框模态(所有模态)的语法是什么?

最佳答案

你应该使用下一个方法:

bootbox.hideAll();

文档引用:http://bootboxjs.com/documentation.html#bb-function-hideAll

关于javascript - 如何隐藏 bootbox.js 模态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51586506/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com