tags:

views:

50

answers:

1

fullcalendar 1.4.7 allow adding new events by dropping them onto the calendar from an external list of events. I would like to update the title of an existing event by dropping another event from the same list. How i can do that. I wrote this function (below) and i call it from the "bindSegHandlers" function of fullcalendar.js but it doesn't work, a new event is created.

 function droppableEvent(event, eventElement) {
  eventElement.droppable({
   accept: '.myevent',
   tolerance: 'pointer',
   activeClass: 'ui-state-hover',
   hoverClass: 'ui-state-active',
   drop: function(ev, ui) {
    alert('call dropped');
   }
  });
 }

Can you help me?

thanks

A: 

I found the solution by myself: eventRender is the right place for that!

  $('#calendar').fullCalendar({
    eventRender: function(evt, element) {
      element.droppable({
        accept: '.myevent',
        tolerance: 'pointer',
        activeClass: 'ui-state-hover',
        hoverClass: 'ui-state-active',
        drop: function(ev, ui) {
          alert('call dropped'); 
        }
      });
    },
    ....
    ....
  });

it is not necessary to modify fullcalendar.js

Eureka