Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the default view in fullcalendar on Click

My fullcalendar's default view is month i want to change the view from month too agendaDay on button external button click. i want to know that there is any inbuild function to change it on button click.

$('#calendar').fullCalendar({
            header: {
                left: 'prev,next today',
                center: 'title',
                right: 'month,agendaWeek,agendaDay'
            },
            defaultDate: '2014-06-12',
            defaultView: 'month',
            editable: true,
            events: [
                {
                    title: 'All Day Event',
                    start: '2014-06-01'
                },
                {
                    title: 'Long Event',
                    start: '2014-06-07',
                    end: '2014-06-10'
                },
                {
                    id: 999,
                    title: 'Repeating Event',
                    start: '2014-06-09T16:00:00'
                },
                {
                    id: 999,
                    title: 'Repeating Event',
                    start: '2014-06-16T16:00:00'
                },
                {
                    title: 'Meeting',
                    start: '2014-06-12T10:30:00',
                    end: '2014-06-12T12:30:00'
                },
                {
                    title: 'Lunch',
                    start: '2014-06-12T12:00:00'
                },
                {
                    title: 'Birthday Party',
                    start: '2014-06-13T07:00:00'
                },
                {
                    title: 'Click for Google',
                    url: 'http://google.com/',
                    start: '2014-06-28'
                }
            ]
        });

    });
like image 543
Raja Manickam Avatar asked Sep 28 '22 05:09

Raja Manickam


1 Answers

http://fullcalendar.io/docs/views/changeView/

$('#calendar').fullCalendar( 'changeView', 'agendaDay');
like image 154
eyalb Avatar answered Oct 05 '22 08:10

eyalb