Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

AngularJS UI-calendar eventSources not updated #542

@estellederrien

Description

@estellederrien

AngularJS UI-calendar doesn't update $scope.eventSources data model, after an event Drag and Drop. I need to get the updated model , and nothing works.

I 've tried plenty of things, nothing works.

I've tried few of the solutions mentionned there with no luck :
#276

This is my code :

    /* config object */
        $scope.uiConfig = {
          calendar:{
            height: 600,
            editable: true,
            header:{
              left: 'month basicWeek basicDay agendaWeek agendaDay',
              center: 'title',
              right: 'today prev,next'
            },
            eventClick: $scope.alertEventOnClick,
            eventDrop: $scope.alertOnDrop,
            eventResize: $scope.alertOnResize,
            eventRender: function (event, element) {

                if (event.HighPriority == 1) {
                   event.className ='highPriority';
                }

            }

          }
        }; 

    /* load events source that contains custom events on the scope */
        $scope.events = agendaFactoryLocalStorage.getAgenda();

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

$scope.alertOnDrop = function(event, delta, revertFunc, jsEvent, ui, view){
   $scope.alertMessage = ('Event Droped to make dayDelta ' + delta);
    uiCalendarConfig.calendars.myCalendar.fullCalendar('removeEvents');
 uiCalendarConfig.calendars.myCalendar.fullCalendar('addEventSource',$scope.events);
});

$scope.save_agenda = function(){
        agendaFactoryLocalStorage.updateAgenda($scope.eventSources);
}

$scope.save_agenda still send the same data model, while i 've drag and dropped 1 event , i really dont know what to do, stuck since 3 hours. $scope.eventSources loads correctly, but, drag and drops doesnt change the model, only the 'event ' variable is updated , but it is unique, i 've tried to push it inside $scope.eventSources with no luck

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions