FullCalendar C #

1

I would like to open a modal when I click on a calendar day.

script:

<script>
    $(document).ready(function ()
    {
        $('#calendar').fullCalendar({
            header: {
                left: 'prev,next today',
                center: 'title',
                right: 'month,agendaWeek,listWeek'
            },
            views: {
                listWeek: { buttonText: 'Compromissos' }
            },
            defaultView: 'month',
            defaultDate:  '@(ViewBag.HoraHoje)',
            navLinks: false, // can click day/week names to navigate views
            editable: false,
            eventLimit: false, // allow "more" link when too many event
            selectable: true,
            dayClick: function(date, jsEvent, view, resourceObj) {
                $('#id01').dialog();
}
        });

    });
</script>

html:

    <body>
<div id="calendar"></div> 
<div id="id01" class="w3-modal">
    <div class="w3-modal-content">
        <div class="w3-container">
            <p>Some text. Some text. Some text.</p>
            <p>Some text. Some text. Some text.</p>
        </div>
    </div>
</div>

    
asked by anonymous 13.03.2017 / 12:53

1 answer

0

According to the documentation at: dayClick

$('#calendar').fullCalendar({
dayClick: function(date, jsEvent, view, resourceObj) {

    alert('Date: ' + date.format());
    alert('Resource ID: ' + resourceObj.id);

    }
});

Instead of alert you can put your modal:

$('#seuModal').dialog(); //por exemplo
    
13.03.2017 / 12:57