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

倖福魔咒の 提交于 2019-12-12 05:51:12

问题


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. 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.

Current code snippet:

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

Kindly suggest.


回答1:


Sometimes in eventDrop function if not work if { } not given. 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.

Working url:: https://jsfiddle.net/rekdp2wt/



来源:https://stackoverflow.com/questions/43125196/show-a-bootstrap-popup-and-then-revert-the-eventdrop-in-fullcalendar-based-on-us

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!