-
Notifications
You must be signed in to change notification settings - Fork 727
events/eventSources is not updating #276
Comments
Same here, I've been trying out as well. Also tried out rerenderEvents and refetchEvents, in my case event they are rendered twice (the events on the day are duplicated) |
Same here @mattoliver |
Try to identify the problem by using ng-inspector -tool for Firefox / Chrome or Batarang 0.4.3 for Chrome. I just took a quick look at my calendar, and it seems that eventSources are saved to 2 different scopes. Try to identify which scope you are splicing and look if both eventsources have changed. If not, there lies the problem. EventSources needs to be changed for both scopes. Edit: Ofc, problem might be something else entirely, but I just gave an idea. |
hey @Sefriol , thanks for your help with this! I checked and both the $scope as well as the uiCalendar object both have the updated eventSources object, but are still not updating on the calendar itself. Here is what the object looks like:
|
I honestly don't know what fixed it for me, unfortunately I was changing a lot at the same time. But here is the code that finally works for me (its pretty ugly since I've been changing/playing with so many different solutions):
|
I believe this is a duplicate of #275 |
Any updates? |
At least some of the problems were fixed when I last time tried to use it with the latest version. I honestly don't have time for this project atm, but I think it would help others to figure this out, if you tell when this problem occurs and how to replicate it now. @EsteBusta |
You're right @Sefriol, i did some manually using to handle this issue (some ng -if and timeout) , it is not the best way , but if i will try to make it better to Contribute ! Greetings ! |
Hi Guys, I solved this forcing to refresh the calendar directive in this way in my controller when update the arrays of the calendar I put somthing like this //before perform operation // at the end I get a little flicker due to refreshing the directive but works I hope this help somebody regards |
Hi! It's been a long time since this issue was opened, any news? |
My solution: Regards, Nicholls |
👍 Did @jdnichollsc solution,
|
+1 for @jdnichollsc solution. Thx! |
+1 for @jdnichollsc solution. Thanks a lot. |
+1 for @jdnichollsc solution. |
@jdnichollsc cloud you explain it more clear? I don't know where to add it, thank you |
@qidaneix Hey.. To answer your question, I added these two lines in my controller where you are initializing the eventSource. And I did it right after I assigned values to my eventSource Array. |
@HashtagPurvi Hey. I did it the same way, but it does not work yet. I added them after the eventSource gets data from ajax request, The events added from ajax request would not show in the calendar when I switch the month(prev and next). Do you know how to solute it? Thank you anyway! |
I suggest debugging through the code and see if your date is coming in right format. |
Oh, my problem is more like #99 , but I did find a good solution. Here is my code
When I get the resEvents at first, it can showed on calendar. When I switching month, the events from resEvents wouldn't show any more, others are there still. I don't know why it happened |
@HashtagPurvi I got it!
for every event. |
|
+1 for @jdnichollsc solution. |
I got the same problem. However, I think I might've found the real answer why it's not working. Then most of you expect that once you change $scope.events the calendar changes. To make a long story short. What fixed it for me was actually changing $scope.eventSources[0]. That'll trigger a update in full calendar. Code example from what I've got running:
I intentionally left $scope._days defined to make it easier to understand what is going on. The real problem lies with this ridiculous ng-model. I suggest just having a that contains ng-model="days" instead of this ng-model="eventSources" thing. Hope it helps. |
This is how i do it :
|
This is my solution: $scope.$on('eventChanged', function(event, data) {
console.log('eventChanged');
$timeout(function () {
// Event update
$scope.events.push({
title: 'New event',
start: new Date(y, m, 24)
});
}, 1);
}); |
Hi, Ex; I hope, it works.Thanks.. |
Hi
|
yimseknyCorarl solution work for me, btw i'm using Angular2 with full calendar, thx! |
Hi, This works for me
VERY IMPORTANT Thanks, |
I'm glad that my solution has been useful, @mattoliver I think you can close this issue |
I have tried every solution I have found, including rerenderEvents, refetchEvents, etc. I even spliced the array to empty it and then pushed each event back on the array to no success. Here is my code for updating eventSources (shortCalendar is the source array that is updated via factory):
Thanks so much for any help, really appreciated.
The text was updated successfully, but these errors were encountered: