ClickerMonkey / dayspan-vuetify

A collection of components that visualizes DaySpan Calendars and Schedules using Vuetify
MIT License
1.16k stars 253 forks source link

Edit error when calendarAppEventDialog is edited #210

Open wolfy007 opened 4 years ago

wolfy007 commented 4 years ago

Hi again! :)

I have an issue, when i am trying to add new inputs to the Event. I am adding the template calendarAppEventDialog to the ds-calendar-app and inside the dialog.

``

But if I want to edit an existing event, it throws an error with an edit function:

`Error in event handler for "edit": "TypeError: Cannot read property 'edit' of undefined"

found in

---> DsCalendarEventTime DsDayTimes DsDaysView DsCalendar DsGestures VContent DsCalendarApp VApp App> at src/App.vue Root`

Did I miss something? P.S.: Create is working perfectly with passed functions.

wolfy007 commented 4 years ago

To my EventPopover I passed :edit="editEvent" function which i have written in the App.vue. In my EventPopover component I modified @click="edit" part to @click="edit(calendarEvent)" which is the prop and in the App.vue editEvent got the ev parameter and it looks like this: let calendarEvent = ev; let eventDialog = this.$refs.eventDialog; eventDialog.edit(calendarEvent);

Is this a good method or is there an easier/better solution?