0

I've been using the ui-calendar for an application. But, today I've got a problem that when I change the month (for example, click the button and go from February to March and after this I go back) my events gone.

When I load: captura de tela 2017-02-06 as 13 01 53

When I Change: captura de tela 2017-02-06 as 13 02 03

When I Go Back: captura de tela 2017-02-06 as 13 02 13

The code config I've been using this time.

`

$scope.alertOnEventClick = function(date, jsEvent, view) {
    console.log('evento clicado', date, jsEvent, view);
}

$scope.eventRender = function( event, element, view ) {
    element.attr({'tooltip': event.title, 'tooltip-append-to-body': true});
    $compile(element)($scope);
};

$scope.changeView = function(view,calendar) {
  uiCalendarConfig.calendars[calendar].fullCalendar('changeView',view);
};

$scope.renderCalender = function(calendar) {
  if(uiCalendarConfig.calendars[calendar]){
    uiCalendarConfig.calendars[calendar].fullCalendar('render');
  }
};

$scope.eventSources = [$scope.events];

$scope.uiConfig = {
  calendar:{
    lang: 'pt-br',
    height: "parent",
    editable: false,
    theme:true,
    header:{
        left: '',
        center: 'title',
        right: 'today, prev,next'
    },
    eventClick: $scope.alertOnEventClick,
    eventRender: $scope.eventRender
  }
};

`

Hugo Deiró
  • 224
  • 2
  • 13

1 Answers1

1

It's an issue in ui-calendar. I've found a solution where I change the function onAdded to:

  eventsWatcher.onAdded = function (event) {
     if (calendar && calendar.fullCalendar) {
          calendar.fullCalendar('renderEvent', event, true);
     }
  };
Hugo Deiró
  • 224
  • 2
  • 13