I need help bringing some data from a json file via Fullcalendar, but I can't.
My JS code, where I instantiated the calendar and called the json file.
But I can't bring in data other than: start, end, title.
I need the data: professional patient health insurance
document.addEventListener('DOMContentLoaded', function() {
var calendarEl = document.getElementById('calendar');
var calendar = new FullCalendar.Calendar(calendarEl, {
locale: 'pt-br',
initialView: 'dayGridMonth',
navLinks: true,
headerToolbar: {
left: 'prev,next',
center: 'title',
right: 'dayGridMonth,timeGridWeek,timeGridDay'
},
events: { url: "../server/consulta/list_consultas.php" },
//CLICK ON EVENT
eventClick: function(info) {
$('#modalConsulta #inicio').text(info.event.start).toLocaleString();
$('#modalConsulta #profissional').text(info.event.profissional);
$('#modalConsulta #paciente').text(info.event.paciente);
$('#modalConsulta #convenio').text(info.event.convenio);
$('#modalConsulta').modal('show');
return false;
}
});
calendar.render();
});
I was looking to bring the data saved in the database inside a modal with js via json
source https://stackoverflow.com/questions/76447548/fullcalendar-returning-custom-data-via-json
No comments:
Post a Comment