1

Is there a way to change the name of the id field that fullCalendar uses? Like this:

$('myCal').fullCalendar('option', 'idField', 'myCustomIdField').

Or like this:

$('myCal').fullCalendar('option', 'idFunction', function(event){
    return "prefix_" + event.id;
}).

thanks for advice

Dany Dhondt
  • 881
  • 9
  • 27
  • There's no such option listed in the docs at https://fullcalendar.io/docs/ . So I see no reason why this would work. Anyway why would you need to change it? – ADyson Oct 04 '17 at 08:22
  • If your event feed items have an id that is not labeled as **id** you can use [eventDataTransform](https://fullcalendar.io/docs/event_data/eventDataTransform) to convert it to the required [event object](https://fullcalendar.io/docs/event_data/Event_Object/) format – smcd Oct 04 '17 at 13:36
  • My events array contains objects from different sources. Like 'CalendarEvent' objects, mixed with 'CalendarEventException' objects. All my objects come from a database feed and have an id field (I can't rename that). So it is possible to have 2 events with the same id. FullCalendar treats these objects linked to each other. Like you suggested also, I had to use the eventDataTransform method to cope with this. In that function, I mapped FC id's to respectively 'ce_1' and 'cee_1'. Now all works well! – Dany Dhondt Oct 04 '17 at 16:47

1 Answers1

0

There is no idField function. the eventDataTransform option is indeed the only way to do this

Adeel
  • 2,901
  • 7
  • 24
  • 34
Dany Dhondt
  • 881
  • 9
  • 27