jquery - FullCalendar: Drop an event but can't update this event -
i implemented fullcalendar http://arshaw.com/fullcalendar/ coldfusion. drop events outside calendar. working well, can't update event
$('#calendar').fullcalendar('updateevent', responsetext.newid);
i need this, can put new id dem database on event, other actions resize, drop other day or delete it.
i reload whole site, it's not userfriendly, because month month , not month selected before.
my code looks this:
drop: function(date, allday) { // function called when dropped // retrieve dropped element's stored event object var originaleventobject = $(this).data('eventobject'); // need copy it, multiple events don't have reference same object var copiedeventobject = $.extend({}, originaleventobject); // assign date reported copiedeventobject.start = date; copiedeventobject.allday = allday; // render event on calendar // last `true` argument determines if event "sticks" (http://arshaw.com/fullcalendar/docs/event_rendering/renderevent/) $('#calendar').fullcalendar('renderevent', copiedeventobject, true); var formdata = "startdatum="+copiedeventobject.start; $.ajax({ url: '<cfoutput>#application.tartalomurl#</cfoutput>mod_kalender/act_event_ins.cfm', data: formdata, type: "post", datatype: "json", cache: false, success: function(responsetext){ $('#calendar').fullcalendar('updateevent', responsetext.newid); } }); },
does has idea i'm programming wrong?
please refer fullcalendar documentation: arshaw fullcalendar updateevent
you need event using updateevent method i.e.:
$.ajax({ url: '<cfoutput>#application.tartalomurl#</cfoutput>mod_kalender/act_event_ins.cfm', data: formdata, type: "post", datatype: "json", cache: false, success: function(responsetext){ originalevent.id = responsetext.newid; //use originating event object , update $('#calendar').fullcalendar('updateevent', originalevent); } });
Comments
Post a Comment