I'm using Fullcalendar and I'm trying to update events. I'm trying to make an ajax callback to get def edit of that event. The route would be /controls/:id/edit, so I've built this ajax callback:
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: Cannot read property 'clone' of undefined". I don't know what that means. I think I'm doing it right but it doesn't work. Anyone could help me?? Thank you in advance.
I'm using Fullcalendar and I'm trying to update events. I'm trying to make an ajax callback to get def edit of that event. The route would be /controls/:id/edit, so I've built this ajax callback:
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: Cannot read property 'clone' of undefined". I don't know what that means. I think I'm doing it right but it doesn't work. Anyone could help me?? Thank you in advance.
javascript
ajax
fullcalendar
Share
Improve this question
edited Aug 13, 2019 at 11:59
Mohit Verma
5,29422 gold badges1414 silver badges2828 bronze badges
asked Dec 7, 2014 at 13:57
David DsrDavid Dsr34722 gold badges55 silver badges2020 bronze badges3
jsfiddle, if you can that would help me to help you :)
– Sadik
CommentedDec 7, 2014 at 13:59
Ok, this is the link jsfiddle/daviddsr/58fsceLd/1 I had never used jsfiddle. The problem is that I'm using Rails and jsFiddle just let me put HTML, CSS and JavaScript so...I don't know if it will help you to much. Maybe if I pass you my repository in GitHUb could help you more
– David Dsr
CommentedDec 7, 2014 at 19:29
Ok, I've already found out how to do it. I've just used this: eventClick: function(calEvent, jsEvent, view) { window.location.replace("/controls/"+calEvent.id+"/edit")
– David Dsr
CommentedDec 7, 2014 at 21:33
Add a ment
|
1 Answer
1
Reset to default
1
Please check the event data . Source attribute of your event must be null or not populated. SO before calling
You have to be make sure that required attribute of your fullcalendar event must be populated. Here is the link for required and optional fieldfor event object.