How to create a field in the Fullcalendar Eventclick coordinates

Asked

Viewed 37 times

0

Gostaria de editar essa linha

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?

  • 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

  • How do I open this field? I couldn’t find an example, because the events I managed, both with eventclick and select.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.