Fabrizio La Racca
Fabrizio La Racca

Reputation: 75

Fullcalendar 4: Events not rendered in resourceTimeGridDay

I am using a function to fetch resources (they can change day by day) and it works fine. However there is an issue with events fetching.

After several attempts I found out that events do not get rendered only when I fetch asynchronously my resources.

NOT WORKING:

resources: function(fetchInfo, successCallback, failureCallback){myFunction},
events: function(fetchInfo, successCallback, failureCallback){myFunction}

WORKING:

resources: [{ id: '1', title: 'Room A' }],,
events: function(fetchInfo, successCallback, failureCallback){myFunction}

In both cases when calendar switches to WeekView my events are shown.

I have tried also lo refetchEvents AFTER refetchResources but to no avail.

Has anybody faced the same issue?

Upvotes: 0

Views: 291

Answers (1)

Fabrizio La Racca
Fabrizio La Racca

Reputation: 75

My fault(obviously). I was creating JSON resources using 'resourceId' instead of 'id'. It now works perfectly

Upvotes: 1

Related Questions