Fullcalendar update events AJAX

Fullcalendar update events AJAX

  

Hi, I'm adding new events using AJAX, and after that I need to update the events, but I could not get it, could you help me? I already asked in stackoverflow, and I have not had any useful answers.


$("#btn_insert").click(function(){
     
    var rut_usu = $("#rut_usu").val();
    var rut_estu = $("#rut_estu").val();
    var id_mot = $("#id_mot").val();
    var fecha_ini = $("#fecha_ini").val();
    var fecha_ter = $("#fecha_ter").val();

 
    $.ajax({

     url: "<?php echo base_url(); ?>" + "cCalendar/insertar_cita/",
     type: 'post',
     data: { "rut_usu": rut_usu, "rut_estu": rut_estu, "id_mot" : id_mot , "fecha_ini": fecha_ini , "fecha_ter": fecha_ter},

     success: function(response){

           $("#modal_registrar").modal('hide');
           document.getElementById("form_ingresar").reset();
           $("#modal_confirmar").modal('show');

         
              $('#calendar').fullCalendar('removeEvents');        
             $('#calendar').fullCalendar("refetchEvents");

 
           //console.log(response);
      }
 
});
    });


Curiously removeEvents if it works...


PD:  I'm sorry if I sound like an idiot, my English is not very good.

What events you need to update after AJAX?

Please provide more explanation of  your use case.

Suraj Borade wrote:

What events you need to update after AJAX?

Please provide more explanation of  your use case.

btn_insert is a button, which when pressed, saves the data I have entered in a modal, then should update the events on the screen, but it does not. If I load the page, the new events that I have entered are shown.