1

I am trying to drop an external event into a resourceTimeGridDay but can't find the current resource id in the view. Where in the info object is the resource id listed?

 eventReceive(info) {
      console.log("eventReceive:", info);
    }
ADyson
  • 57,178
  • 14
  • 51
  • 63
  • https://fullcalendar.io/docs/eventReceive says "When an event has been dropped on a resource, the event’s resources will reflect.". I haven't time to test it (and it's badly worded), but I take that to mean that it will be part of the event object (i.e. `info.event.resourceId`. Or I suppose it might generate an array under `info.event.resourceIds` with a single element in it (as per https://fullcalendar.io/docs/resources-and-events)). Have you tried that? – ADyson Jan 08 '20 at 11:15
  • If found the single item array in info.event._def.resourceIds. Is that the "standard" object to extract from? It would feel better to have found it as you suggest under info.event.resourceId:-) – Daniel Jarl Jan 08 '20 at 12:08
  • Did you try `info.event.resourceIds` also? (It should be an array, I think, under that property). I would not expect you'd need to use the `_def` property which I think is supposed to be internal (it's not mentioned in any of the API documentation). If the value isn't being exposed via either `resourceId` or `resourceIds` then it might be worth raising a bug ticket. – ADyson Jan 08 '20 at 12:12
  • No resourceId/s in info.event object. I will consider posting a bug ticket. – Daniel Jarl Jan 08 '20 at 12:33

2 Answers2

1

Problem is solved.

info.event.getResources() will return an array of resources.

Here is the solution: https://github.com/fullcalendar/fullcalendar/issues/5215#event-2936400933

0

The resource is in : info.event._def.resourceIds

console.log('eventReceive', info.event._def.resourceIds);

Philippe
  • 11
  • 1
  • Hi. Thank you for your reply but we have already confirmed that but _def is an internal object and is nowhere to be found in documentation. – Daniel Jarl Jan 09 '20 at 11:04