我正在为我的大学项目使用 Bootstrap 4 Beta 和 JavaScript,我正在制作一些日历事件功能。我习惯了Bootbox.js对于弹出窗口,我的问题是当我单击日历事件警报时显示,但此警报无法自定义,我想知道如何添加 <div>
<button>
text
和etc
对于此警报,请看我的附图,您可以理解它
这是我的脚本
事件
dp.events.list = [{
start: "2017-12-20",
end: "2017-12-28",
id: "1",
resource: "A",
text: "Mahesh",
backColor: "#70CB85",
},
点击
dp.onEventClicked = function(args) {
bootbox.alert(" " + args.e.text()); //Alert
};
最佳答案
来自他们的documentation :
An alert callback should not supply an argument; it will be ignored
如果您想传递按钮,可以使用confirm
:
bootbox.confirm({
message: "This is a confirm with custom button text and color! Do you like it?",
buttons: {
confirm: {
label: 'Yes',
className: 'btn-success'
},
cancel: {
label: 'No',
className: 'btn-danger'
}
},
callback: function (result) {
// ...
}
});
或者使用对话框:
bootbox.dialog({ message: '<div class="text-center"><i class="fa fa-spin fa-spinner"></i> Loading...</div>' })
关于javascript - 关于事件点击问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47688450/