0
To create an editable field in the eventclick coordinates
[JS]
$('#calendariousuariodia').fullCalendar({
header: {
right: 'month,agendaDay'
},
defaultView: 'agendaDay',
allDay: true,
selectable: true,
nowIndicator: true,
events:
{
url: 'estrutura/agendauser.php',
error: function() {
console.log('Não existem eventos para exibir!');
}
},
eventRender: function(eventObj, $el) {
$el.popover({
title: eventObj.title,
content: eventObj.description,
trigger: 'hover',
placement: 'top',
container: 'body'
});
},
select: function(start, end, allDay) {
var cbmdoutor = document.getElementById('cbmdoutor').value
if(cbmdoutor == ""){
toastr["error"]('Favor selecionar um Cirurgião');
$("#cbmdoutor").focus();
exit;
} else {
$('#txttitulo').show();
$('#txtdesc').show();
$("#txttitulo").focus();
$("#dtstart").val(moment(start).format('DD/MM/YYYY'));
$("#dtend").val(moment(end).format('DD/MM/YYYY'));
$("#hrstart").val(moment(start).format('HH:mm'));
$("#hrend").val(moment(end).format('HH:mm'));
}
},
eventClick: function(calEvent, jsEvent, view) {
alert('Event: ' + calEvent.title);
alert('data: ' + calEvent.id);
alert('Coordinates: ' + jsEvent.pageX + ',' + jsEvent.pageY);
alert('View: ' + view.name);
// Ja tenho as coordenadas
$(this).css('border-color', 'red');
}
});
I also ask: how you will edit this?
– Sam
Jefferson, if you read the documentation you will see that the event
eventClick
passes as parameters the coordinates of the event that was clicked, then you can put an editable field "above" the event and then save, see here: https://fullcalendar.io/docs/eventClick– Ricardo Pontual
How do I open this field? I couldn’t find an example, because the events I managed, both with eventclick and select.
– Jefferson Meireles