FullCalendar - prompt on dayClick only in certain views

匿名 (未验证) 提交于 2019-12-03 01:26:01

问题:

In FullCalendar, is there a way to avoid opening a event insertion prompt when I click on a day in monthView? What I want to do is a changeview and go to the clicked date, which is working, but the prompt is still opening.

dayClick: function(date, jsEvent, view){     //This works fine, but open a prompt to add new event     $("#calendar").fullCalendar('changeView','agendaWeek');     $("#calendar").fullCalendar('gotoDate',date); } 

Thanks for any help.

回答1:

Seems, you are showing prompt in "select" event callback.

If you want to handle "select" event for day/week view and not for month view, you can check the current view and act accordingly.

Ex.

if($('#calendar').fullCalendar('getView').type != 'month') { } 


易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!