Fullcalendar +事件drop + ajax + bootstrap模式

时间:2014-09-08 21:32:44

标签: javascript jquery ajax twitter-bootstrap fullcalendar

我正在使用fullcalendar,我对此代码有疑问:

eventDrop: function(event, dayDelta, minuteDelta, allDay, revertFunc) {

            $.ajax({ 
                url: 'index.php?option=com_component&view=verify&layout=verify', 
                data: 'id=5', 
                dataType: 'json', 
                success: function(data) 

                    {
                        if((data[0])==0) {
                            $.smallBox({
                                title : "<b>OK!!</b>",
                                content : “The event has moved correctly!",
                                color : "#739E73",
                                timeout: 3600,
                                icon : "fa fa-check shake animated"
                            });

                        } else {
                            $('#remoteModal').modal({
                                backdrop: false,
                                keyboard: false
                            });
                            $('#remoteModal').on('hide.bs.modal', function () {
                                    revertFunc();
                                    console.log(ev_drag);
                                    ajaxcall.abort();
                            });

                        }
                    }
             });
             },

因此,当我删除一个事件并且ajax请求的结果不为0时,它会启动一个模态窗口,向用户询问一些设置。当用户关闭模态时,启动revertFunc();此功能仅在第一次正常工作:如果有第二次或第三次(等等......)一系列事件并且启动了revertFunc(),则所有已删除的事件都将在日历上移动..

你能帮帮我吗?

0 个答案:

没有答案