Open estellederrien opened 5 years ago
I have added
console.log($scope.events); console.log($scope.eventSources);
inside the $scope.alertOnDrop function, and both are not updated after a drag and drop
This is how my event look like when i dragged it š
_allDay: false
ā
_end: Object { _isAMomentObject: true, _i: "2019-02-01T23:00:00.000Z", _f: "YYYY-MM-DDTHH:mm:ss.SSSSZ", ā¦ }
ā
_id: 2
ā
_start: {ā¦}
āā
_ambigZone: true
āā
_d: Date 2019-02-19T23:00:00.000Z
āā
_f: "YYYY-MM-DDTHH:mm:ss.SSSSZ"
āā
_fullCalendar: true
āā
_i: "2019-01-29T23:00:00.000Z"
āā
_isAMomentObject: true
āā
_isUTC: true
āā
_locale: Object { _months: (12) [ā¦], _monthsShort: (12) [ā¦], _fullCalendar_weekCalc: "local", ā¦ }
āā
_offset: 0
āā
_pf: Object { empty: false, overflow: -1, charsLeftOver: 0, ā¦ }
āā
_tzm: -0
āā
<prototype>: Object { add: hb()
, calendar: jb(), clone: clone()
, ā¦ }
ā
allDay: false
ā
className: Array [ "evenement" ]
ā
color: "black"
ā
end: Object { _isAMomentObject: true, _i: "2019-02-01T23:00:00.000Z", _f: "YYYY-MM-DDTHH:mm:ss.SSSSZ", ā¦ }
ā
source: Object { events: (6) [ā¦], className: [], origArray: (6) [ā¦] }
ā
start: Object { _isAMomentObject: true, _i: "2019-01-29T23:00:00.000Z", _f: "YYYY-MM-DDTHH:mm:ss.SSSSZ", ā¦ }
ā
stick: true
ā
title: "Equipe 2 vs equipe 3"
ā
<prototype>: {ā¦
Please notice that the correct new date is _d , and the ancient date is _f
Well, i 've found something who will probably work , it is updating $scope.eventSources correctly now after dragging:
$scope.alertOnDrop = function(event, delta, revertFunc, jsEvent, ui, view){
$scope.alertMessage = ('Event Droped to make dayDelta ' + delta);
$scope.eventSources[0][1].start = event.start.format();
};
it is updating the old date value with the dragged date value i still have to get the correct index each times .
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 : https://github.com/angular-ui/ui-calendar/issues/276
This is my code :
$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