How is possible get and event by the event id of fullcalendar bootstrap?
I have the event id and I want get the event from this. I'm trying this:
var evento = $("#calendar").fullCalendar( 'clientEvents')[response.idEvent];
response.idEvent is the id event, this is correct (for example '32' from my mysql database), I know this because I print this and is correct, but I don't know how to get the event from this...
How can get this?
Thanks!
Calendar::getEvents Retrieves events that FullCalendar has in memory. This method will return an array of Event Objects that FullCalendar has stored in client-side memory.
fullCalendar('addResource', { id: 'e', title: 'Room E' }); If you would like the new resource to be a child of an existing resource, make sure to set its parentId . If the scroll argument is true , the current view will scroll to the newly added resource to ensure it is visible.
although it is not specified on the fullcalender site, it is necessary to assign a value to the "allday" parameter to be able to add new events dynamically. If you set this value to "false", it will not add the event to the AllDay row. If you do "true" it will add to the AllDay row. Save this answer.
According to the FullCalendar's documentation, you can achieve what you want by doing:
var evento = $("#calendar").fullCalendar('clientEvents', response.idEvent);
The brackets in the documentation mean that the parameter is optional.
If you want just get all properties of event you can add the [0] and choose properties through dot. For example you have event id as "_fc1" (got it from http://fullcalendar.io/js/fullcalendar-2.4.0/demos/agenda-views.html):
var eventoObj = $("#calendar").fullCalendar( 'clientEvents', "_fc1")[0];
var evento_allDay = eventoObj._allDay;
var evento_start = eventoObj._start;
var evento_end = eventoObj._end;
etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With