jquery - How to change full calendar views -
i using fullcalendar , showing monthly view .
i using following code initialize full calendar.
$(document).ready(function() { $('#calendar').fullcalendar({ header: { left: 'prev,next today', center: 'title', right: 'month,agendaweek,agendaday' }, defaultdate: '2014-06-12', 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 google', url: 'http://google.com/', start: '2014-06-28' } ] }); });
but want change view
please suggest how achieve in fullcalendar ? thanks.
to set initial view, add 'defaultview' property calendar initialization code. possible view types are:month (default), basicweek, basicday, agendaweek , agendaday. think 1 closely approximates screen shot agendaweek. view examples of each type here.
initial load example:
$('#calendar').fullcalendar({ defaultview: 'agendaweek', defaultdate: '2014-06-12', editable: true, ....the rest of code here
event driven example: change view based on event, such button click, call controls 'changeview' method , pass name of view you'd see.
$('#buttonname').click(function () { $('#calendar').fullcalendar('changeview', 'month'); });
Comments
Post a Comment