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

2

Colleagues.

I am using FullCalendar in an application and the events I was able to register using PHP / Mysql. However, I would like to create links in these events that appear in the calendar and that when clicking these links were directed to a specific page with the description of these events. Is this possible in FullCalendar? See the image below marked in yellow:

Iwouldliketosharethislinkwithyou.Ithasanexampleofhowwecanregister,editanddeleteeventsinFullCalendarusingPHP/mysqlandBootstrap. CRUD with PHP / Mysql in FullCalendar with Bootstrap

    
asked by anonymous 26.01.2017 / 17:14

1 answer

2

I managed to resolve. For it to work, in the table mysql 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>
    
26.01.2017 / 18:11