CroudTech / vue-fullcalendar

FullCalendar Wrapper for vue
MIT License
483 stars 100 forks source link

render-event and remove-event not working #178

Open pcm0nk opened 5 years ago

pcm0nk commented 5 years ago

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.

BrockReece commented 5 years ago

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.

pcm0nk commented 5 years ago

@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!

PhilMDev commented 5 years ago

@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!