Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

340
Views
How to load new events into FullCalendar

I am using FullCalendar 3.2. The problem is if I get the current events from calender and clear then add new ones to array. When I call

$('#calendar').fullCalendar( 'updateEvents',eventsList);

It does not work but throws error

Uncaught TypeError: Cannot read property 'clone' of undefined
    at Y (fullcalendar.min.js:6)
    at Bt.x [as updateEvents] (fullcalendar.min.js:6)
    at HTMLDivElement.<anonymous> (fullcalendar.min.js:6)

This is the code inside the button click handler

var items = $('#calendar').fullCalendar( 'clientEvents');
items.splice(0, items.length);
items.push({
            title: 'All Day Event',
            start: '2017-02-01'
            });
items.push({
            title: 'Long Event',
            start: '2017-02-07',
            end: '2017-02-10'
            });
$('#calendar').fullCalendar( 'updateEvents',items);

I have tried to use jquery version 2.2.4 and 3.1.1 but no luck

<link rel="stylesheet" href="resources/css/default.css">
<link rel='stylesheet' href='resources/css/fullcalendar.css' />
<script src='resources/js/jquery-3.1.1.min.js'></script>
<script src='resources/js/moment-with-locales.min.js'></script>
<script src='resources/js/fullcalendar.js'></script>
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

You can try this: https://fullcalendar.io/docs1/event_rendering/renderEvent/

 $("#calendar").fullCalendar( /* option */);
 var items = [
    {
        title: 'All Day Event',
        start: '2017-02-01'
    }, {
        title: 'Long Event',
        start: '2017-02-07',
        end: '2017-02-10'
    }
];
for ( var i = 0; i < items.length; i++ ) {
    $('#calendar').fullCalendar( 'renderEvent', items[i]);
}

renderEvent : Renders a new event on the calendar.

Note: event must be an Event Object with a title and start at the very least.

Demo here

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!