Lukasz Koziara
Lukasz Koziara

Reputation: 4320

Combine jquery dialog with fullcalendar eventDrop method

I have fallowing piece of code:

eventDrop: function(event,dayDelta,minuteDelta,allDay,revertFunc) {
if (!confirm('some question')) {
    revertFunc();
}
else {
    $.ajax({
        url: '/some/url/',
        error: function(){
            revertFunc();
            alert('some text');
        },
    });
}

}

and I want use jquery dialog instead of standard js confirm box with eventDrop method (with revertFunc).

Any ideas to do that?

Upvotes: 0

Views: 863

Answers (1)

Lukasz Koziara
Lukasz Koziara

Reputation: 4320

I couldn`t find way to use jquery dialog and revertFunc within eventDrop method, so I made some workaround:

  • on eventDrop call jquery dialog with url as parameter:

    url = '/some/url/with/datetime'; $('#dialog-confirm').data('url', url).dialog('open');

  • on dialog options define buttons with call ajax on confirm and 'refetchEvents' on cancel (instead of 'revertFunc' in eventDrop):

    $('#calendar').fullCalendar( 'refetchEvents' );

Upvotes: 0

Related Questions