问题
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') {
}
来源:https://stackoverflow.com/questions/33937742/fullcalendar-prompt-on-dayclick-only-in-certain-views