Create links to events created in fullcalendar and open in a Bootstrap modal

Asked

Viewed 707 times

2

Colleagues.

I am using Fullcalendar in an application and the events managed to register using PHP/Mysql. However, I would like to link to these events that appear on the calendar and when clicking on these links to a specific page describing these events. Is this possible in Fullcalendar? See the image below marked in yellow:

inserir a descrição da imagem aqui

Taking advantage, I want to share with you this link. It has an example of how to register, edit and delete events in Fullcalendar using PHP/mysql and Bootstrap. CRUD with PHP/Mysql in Fullcalendar with Bootstrap

1 answer

2


I was able to solve it. In order for it to work, in the mysql table you have to respect the nomenclature: title, start and Description. First I put the Bootstrap modal:

<div id="fullCalModal" class="modal fade">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span> <span class="sr-only">close</span></button>
                <h4 id="modalTitle" class="modal-title"></h4>
            </div>
            <div id="modalBody" class="modal-body"></div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>

And in Jquery:

<script>
   $(document).ready(function() {
       $('#calendario').fullCalendar({
            height: 300,
            contentHeight: 360,
            editable: false,
            eventLimit: true,
            events: 'eventos.php',
            eventColor: '#dd6777',

            eventClick:  function(event, jsEvent, view) {
            $('#modalTitle').html(event.title);
            $('#modalBody').html(event.description);
            $('#eventUrl').attr('href',event.url);
            $('#fullCalModal').modal();
        }
        });
 });
</script>

Browser other questions tagged

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