简体   繁体   English

显示一个Bootstrap弹出窗口,然后根据用户的选择恢复FullCalendar中的eventDrop

[英]Show a Bootstrap popup and then revert the eventDrop in FullCalendar based on user's choice

Currently I am using Javascript confirm box to ask whether the user wants to proceed or he wants to revert, but I need to warn the user using Bootstrap popup. 当前,我正在使用Javascript确认框询问用户是否要继续还是他要还原,但是我需要使用Bootstrap弹出窗口警告用户。 User needs to say 'Proceed/Cancel' in popup. 用户需要在弹出窗口中说“继续/取消”。

I used bootstrap modal popup. 我使用了引导程序模式弹出窗口。 but the 'drop' doesn't wait for user's choice. 但是“删除”不会等待用户的选择。 It executes the flow of code written inside 'eventDrop', before user clicks yes/no button of popup. 在用户单击弹出窗口的“是/否”按钮之前,它将执行写在“ eventDrop”内部的代码流。

Current code snippet: 当前代码段:

eventDrop: function(event, delta, revertFunc) {
        if (!confirm("Are you sure to re-book the ticket?"))
            revertFunc();
}

Kindly suggest. 请提示。

Sometimes in eventDrop function if not work if { } not given. 有时在eventDrop函数中, if未给出{ }不起作用。 So, please follow my code below:: 因此,请遵循以下代码:

eventDrop: function(event, delta, revertFunc) {
    if (!confirm("Are you sure to re-book the ticket?")) {
      revertFunc();
    }
}

But it will be better to use a confirmbox or bootstap cofirm modal because if any user checks prevent this page from additional dialogs , from next time that alert box will not show. 但是最好使用confirmboxbootsap cofirm模式,因为如果有任何用户检查阻止此页面进入其他对话框 ,则下次不会显示该警告框。

Working url:: https://jsfiddle.net/rekdp2wt/ 工作网址:: https://jsfiddle.net/rekdp2wt/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM