FullCalendar Scheduler: Help, Can't refetch events based on App Connect form success

Hi All,

I’m trying to have my event source update in my FullCalendar Scheduler when an app connect form is submitted and successful (i.e. basic change event details times etc)

I have the FullCalendar timeline view working well, and have an ‘eventClick’ callback that opens a modal in Wappler and passes the eventID from the eventClick action to a variable in Wappler to be used in the form. This is the eventClick snippet:

image

I now need to use the FullCalender method ‘calendar.refetchEvents()’ in order to update the events from the database.

QUESTION:

How can I find a way to use this method in the JavaScript file but have it TRIGGERED by the form in App Connect (currently called updateEventForm)??

Is there correct syntax to use something like updateEventForm.success() in dmx.parse? If so, would i need to use it as part of an IF statement?

Just to confirm, if I simply put ‘calendar.refetchEvents()’ in my eventClick function it DOES work and update the data, but at the wrong time…i.e. when you click the event and open the modal. I need it to trigger when the form has been submitted/ondone.

Here is my full FullCalendar file:

Ok. So if anyone fins this… I have solved it and have been able to refetch the events based on an App Connect event trigger.

I’m sure those who know JavaScript would have figured it out easily, but this took me quite a while :slight_smile:

Basically I simply added this code:

What this is doing is adding an ‘event listener’ to basically watch out for particular changes to an element in the document.

By choosing the form element (updateEventForm in my case) and adding the ‘reset’ event, i can then run the function ‘calendar.refetchEvents’ which will reload my event source.

In App Connect, I simply needed to add a ‘Form Reset’ on the updateEventForm form under the ‘on success’ dynamic event:

Now, the form is submitted, and when it has updated the database and returns a ‘success’ event it fires offa few things, included the form reset which in turn re-fetches the event data in FullCalender.

Happy days.

The JS file for FC now looks like this:

1 Like