Reputation: 21
I'm trying to use the editable resource in FullCalendar and it's working very well when I drag the event to another day, but when I just don't want to drag the event anymore and drag it to the same day it was before, all of the other events become disabled and I can't drag any of them.
Could you, please, help me?
Here is my code
editable: true,
eventDrop: function(info){
$.ajax({
type: "POST",
url: "<?php echo _Z_URL_ . $pkgnm; ?>control.php",
data: {
action: 'change_date',
age_id: info.event.id,
age_data: info.event.start.toLocaleString(),
age_end: info.event.end.toLocaleString(),
},
success: function(data){
if(data >= 1){
toastr.success('<?php echo constant("A data do evento foi alterada com sucesso!"); ?>', '<?php echo constant("Informação!"); ?>', {"closeButton": true, "timeOut": "2000"});
window.setTimeout(function () {
}, 2000);
} else if(data === '-1'){
toastr.error('<?php echo constant("O sistema encontrou um registro com esse recurso no mesmo horário!"); ?>', '<?php echo constant("Erro!"); ?>', {"closeButton": true, "timeOut": "2000"});
window.setTimeout(function () {
window.location = "<?php echo _Z_URL_ . $pkgnm; ?>";
}, 2000);
} else if(data === '-2'){
toastr.error('<?php echo constant("Não é possível alterar a data de um evento que não é seu!"); ?>', '<?php echo constant("Erro!"); ?>', {"closeButton": true, "timeOut": "2000"});
window.setTimeout(function () {
window.location = "<?php echo _Z_URL_ . $pkgnm; ?>";
}, 2000);
} else {
toastr.error('<?php echo constant("Ocorreu um erro ao tentar salvar o registro!"); ?>', '<?php echo constant("Erro!"); ?>', {"closeButton": true, "timeOut": "2000"});
window.setTimeout(function () {
window.location = "<?php echo _Z_URL_ . $pkgnm; ?>";
}, 2000);
}
}
})
}, ```
Upvotes: 1
Views: 43
Reputation: 21
Solved!
You just have to add the dragRevertDuration: 0,
after the code editable:true,
to fix this error!
Upvotes: 1