I have a list of event days. When I click on the event in the list I want to fire the same action like I click on calendar. My eventClick function:
eventClick:
Try this. Assign some id to your event. Then, in eventRender event, add this id to the event div. Note there is also eventClick handler present:
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,basicWeek,basicDay'
},
defaultDate: '2016-09-12',
navLinks: true, // can click day/week names to navigate views
editable: true,
eventLimit: true, // allow "more" link when too many events
events: [
{
title: 'Meeting',
start: '2016-09-12T10:30:00',
end: '2016-09-12T12:30:00',
id: "1234"
}
],
eventRender: function (event, element, view) {
element.find('.fc-content').attr("id", "event-" + event.id);
},
eventClick: function (event, jsEvent, view) {
alert(event.id);
},
});
Then call this after your events list click:
$('#event-1234.fc-content').trigger('click');
You can try it here:
http://jsbin.com/fejifovuxo/edit?js,output