Load event data into FullCalendar

Issue #4 resolved
Helge Sverre Hessevik Liseth repo owner created an issue
  • On-Load grab the event data from DB
  • Parse it into fullcalendar compatible format (store everything as json?)

Solutions?

  • Should this be ajax based?
  • Should i just dump the whole event json string in a hidden field somewhere?

Comments (2)

  1. Helge Sverre Hessevik Liseth reporter

    Whenever the page loads the calendar's event property calls loadEvents, this function looks like this:

      function loadEvents() {
            // Get the encoded data from the hidden field
            var encodedEvents = jQuery("#wphs-events").val();
    
            // Un-serialize the data.
            var eventData = decodeURIComponent(encodedEvents);
    
            // Return the events as JSON
            return JSON.parse(eventData);
        }
    
  2. Log in to comment