Unable to read the clone property from undefined

I am using Fullcalendar and I am trying to update events. I am trying to make an ajax callback to get permission to edit this event. The route will be / controls /: id / edit, so I built this ajax callback:

eventClick: function(date, jsEvent, view) { console.log(date.id) console.log(jsEvent) console.log(view) $.ajax({ type: "GET", url: "/controls/"+date.id+"/edit", }); $('#calendar').fullCalendar('updateEvent', event); } 

The control_controller.rb code is as follows:

 def edit if request.xhr? @control = Control.find(params[:id]) end end 

My problem is that when I click on one event, the console tells me "Uncaught TypeError: Unable to read the" clone "property from undefined". I do not know what it means. I think I am doing it right, but it will not work. Can anybody help me? Thank you in advance.

+6
source share
1 answer

Please check the event data. The source attribute of your event must be empty or empty. SO before calling

 $('#calendar').fullCalendar('updateEvent', event); 

You must ensure that the required attribute of your fullcalendar event must be populated. Here is the link for the required and optional field for the event object.

http://fullcalendar.io/docs/event_data/Event_Object/

+1
source

Source: https://habr.com/ru/post/1208529/


All Articles