gpt4 book ai didi

javascript - 如何在单击时更改全日历中的默认 View

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:59:49 25 4
gpt4 key购买 nike

我的 fullcalendar 的默认 View 是月份,我想在按钮外部按钮单击时也从 agendaDay 更改 View 。我想知道是否有任何内置函数可以在单击按钮时更改它。

$('#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'
}
]
});

});

最佳答案

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

$('#calendar').fullCalendar( 'changeView', 'agendaDay');

关于javascript - 如何在单击时更改全日历中的默认 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29739695/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com