Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

341
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda