angular-ui/ui-calendar

events are not rendering properly after refresh.

Closed this issue · 1 comments

Hello, I am facing one strange issue,

image
events are not rendering after the page refresh.

I will try to explain the problem.

When my calendar controller is loaded, i am a calling a method to get the data from the server side and preparing the events objects and binding to the eventSource property. at this time the calendar is rendering with valid data.

When I am trying to refresh the page or hitting the url directly from browser, the calendar controller is making a call to the server and getting the data but in the client side the calendar is not showing the data, when i check the dom the configuration is also rendered properly, but the events sections is not rendering.

Main method in calendarControllerMethod.

`
function returnCalendarConfig() {
return {
calendar: {
height: 500,
editable: false,
displayEventTime: true,
selectable: true,
timeFormat: 'hh:mm A',
stick: true,
defaultView: 'month',
columnFormat: 'dddd',
disableDragging: false,
header: {
left: 'month,agendaWeek,agendaDay',
center: 'title',
right: 'prev,next'
},
eventClick: $scope.onEventClick,
dayClick: $scope.onDayClick,
eventRender: $scope.onEventRender
}
};
}

function getCalendarEvents() {
calendarFactory.eventsGet(params, body, additionalParams)
.then(function (result) {
if (!result.error) {
$scope.uiConfig = returnCalendarConfig();
angular.forEach(result.data, function (item) {
$scope.events.push(mapDataToEventFromat(item));
});
applyScope();
} else { }
// $scope.myCalendar.fullCalendar("refetchEvents");
})
}

getCalendarEvents()`

HTML Markup

<div class="row-fluid" style="background-color:white;padding:5px"> <div class="span12"> <div class="calendar" data-ng-model="eventSources" calendar="myCalendar" ui-calendar="uiConfig.calendar"></div> </div> </div>

Any help appriciated.

How did you solved it? My calendars aren't showing after refreshing page too..