render-event and remove-event not working
Opened this issue · 3 comments
Hi
Brock , you literally saved my career with this component and i am very thankful for that.
now im having problem with render-event(event) & remove-event(event) :
this.$refs.calendar.$emit('render-event',this.newarr);
and my variable (newarr) is :
newarr:[{title:'event111', start:'2018-02-02'}]
Im not getting any error , altho the new event is not added, now im using .push([]) to workaround this and it works fine, but i wonder if i can use the render-event instead of push.
also how can i remove the individual event ? how can i access a unique value like ID on each event ?
Thanks for any help.
Hi @pcm0nk
Glad you find this wrapper useful.
Any chance you could reproduce this in a code-sandbox, and I will have a look at that?
It might be worth looking at the fireMethod. This can be usually used a 'get out of jail free' card, as it allows you to use the native fullcalendar.io methods.
@BrockReece thanks for your reply
unfortunately fireMethod didnt help!
here is a codesandbox , on eventSelected method u can see the codes i tried and my workaround ( giving an additional key and using Vue.delete)
Thanks again!
@pcm0nk not sure if this is still a problem but I wanted to show you what I did for event render. The following is my config settings in my data object:
config: { defaultView: 'agendaWeek', slotDuration: '00:15:00', allDaySlot: false, eventRender: function (event, element) { if (!event.title) { return false } } }
Obviously, you can change anything you wish. In this case I didn't use allDay. After much testing I discovered that I needed the if (!event.title) or it would fire continuously. Further, now all I have to do is add to my events array and every time I do the event is rendered automatically. Ditto for remove. Remove the event from the array and it disappears.
Hope this helps!