Closed GrimGX closed 8 years ago
After 5 hours of trying to get this to work the only way that I could was to embed the eventClick as such:
$scope.uiConfig = { calendar: { height: $scope.calendarHeight, editable: false, header: false, eventClick: function (calEvent, jsEvent, view) {
},
defaultView: 'agendaDay',
selectable: true,
select: function (start, end, allDay, jsEvent, view) {
},
allDaySlot: false,
buttonText: {
today: "Today"
},
titleFormat: "D/MMM/YYYY",
businessHours: {
start: '08:00',
end: '18:00',
dow: [1, 2, 3, 4, 5, 6, 7]
},
}
};
Hope this helps someone else somewhere along the way
I had the same issue. In my case, I had declared the functions after uiConfig declaration and they were not getting fired. Unlike in JS compilation (which is a two sweep process, so variables and functions can be declared where ever), in angular the functions that you use have to be declared before they can be used.
Once I moved the functions to before the uiConfig declaration, things worked just fine
I have added an eventClick to my uiConfig but it will not fire.
Code:
$scope.uiConfig = { calendar: { height: $scope.calendarHeight, editable: false, header: false, eventClick: $scope.eventClick, defaultView: 'agendaDay', selectable: true, select: function (start, end, allDay, jsEvent, view) { alert(start); }, allDaySlot: false, buttonText: { today: "Today" }, titleFormat: "D/MMM/YYYY", businessHours: { start: '08:00', end: '18:00',
then later i add the events to the object using uiCalendarConfig: if (uiCalendarConfig.calendars.MyCalendar == 'undefined') { alert("if"); $scope.MyDayEvents[b] = { id: 1, start: (DATE HERE) }; } else { uiCalendarConfig.calendars.MyCalendar.fullCalendar('renderEvent', { id: 1, start: (DATE HERE) }); }
I have no idea why the eventClick is not firing