Do not get id on full calendar?

1

I have a well-structured code of fullcalendar where I can do anything but one thing. When I click on event , I wanted it to erase and remove from the calendar. It deletes from the database but does not remove it from the calendar.

This is the code I have

events: [
                <?php 
                $data = date("yy-mm-dd");
                $select=mysqli_query($db, "SELECT * from aulas");
                while($mos=mysqli_fetch_assoc($select)){
                    $id_cat=$mos['id_categoria'];
                    $sel_cat=mysqli_query($db, "SELECT * from categorias where id = '$id_cat'");
                    $mos_cat=mysqli_fetch_assoc($sel_cat);
                    $titulo=$mos_cat['nome'];
                ?>
                {
                    title: '<?=$titulo; ?>',
                    color: '<?=$mos_cat['cor']; ?>',
                    start: '<?=$mos["data"]; ?>T<?=$mos["inicio"]; ?>',
                    ini_hour: '<?=$mos["inicio"]; ?>',
                    id: '<?=$mos["id"]; ?>',
                    fin_hour: '<?=$mos["fim"]; ?>',
                    end: '<?=$mos["data"]; ?>T<?=$mos["fim"]; ?>',
                },
                <?php } ?>
            ],

As you can see, I define the id there and everything is presented correctly.

eventClick: function(event, delta, revertFunc) {
    swal({
          title: "Deseja apagar este evento?",
          text: event.title,
          type: "warning",
          showCancelButton: true,
          confirmButtonClass: "btn-danger",
          confirmButtonText: "Apagar",
          cancelButtonText: "Cancelar",
          closeOnConfirm: true,
          closeOnCancel: true
        },
        function(isConfirm) {    
              $.ajax({
                  type: "POST",
                  url: "cod_ajax/apaga_event.php",
                  data: "id="+event.id,
                  cache: false,
                  success:function(e){
                    $("#calendar").fullCalendar( 'removeEvents' [ event.id ] )
                    $("#pop").hide(0);
                    $("#pop").fadeIn("fast");
                  }
              })
        });

},

With the code above, it deletes from the database but does not remove the event, even referring to event.id which I think should be as it should be by HERE shown.

Does anyone know what's wrong?

    
asked by anonymous 03.10.2017 / 19:52

1 answer

0

I discovered what had gone wrong. The code I wrote had caught up with event.id but where I got the code, there is an error that is in .fullCalendar( 'removeEvents' [, idOrFilter ] ) . The "," is wrong in there, it needs to be out of "[]" and now it's working fine.

    
04.10.2017 / 16:21