Ortal Blumenfeld Lagziel
Ortal Blumenfeld Lagziel

Reputation: 2555

fullcalendar get event details on event click

I created a calendar using fullcalender all the events (tasks) are displaying on it. Now i want to open a form which display the event's details, how can i taking the event details by clicking on it? my code:

<script>

    $(document).ready(function () {



        $('#calendar').fullCalendar({
            header: {
                left: 'prev,next today',
                center: 'title',
                right: 'month,agendaWeek,agendaDay'
            },
            defaultDate: '2014-09-12',
            editable: true,
            eventLimit: true, // allow "more" link when too many events
            events: [

                {
                    title: 'Meeting',
                    start: '2014-09-12T10:30:00',
                    end: '2014-09-12T12:30:00'
                }
            ]
        });

    });

</script>
<style>

body {
    margin-top: 40px;
    text-align: center;
    font-size: 13px;
    font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif;
}

#calendar {
    width: 900px;
    margin: 0 auto;
}

</style>
</head>
<body>
<div id='calendar'></div>
</body>

Upvotes: 0

Views: 3209

Answers (1)

msapkal
msapkal

Reputation: 8346

Check the full calendar documentation. Here is the link.

 $('#calendar').fullCalendar({
     header: {
         left: 'prev,next today',
         center: 'title',
         right: 'month,agendaWeek,agendaDay'
     },
     defaultDate: '2014-09-12',
     editable: true,
     eventLimit: true, // allow "more" link when too many events
     events: [

         {
             title: 'Meeting',
             start: '2014-09-12T10:30:00',
             end: '2014-09-12T12:30:00'
         }
     ],
     eventClick: function(event) {
         if (event.title) {
             alert(event.title);
         }
     }

 });

Upvotes: 1

Related Questions