FullCalendar - prompt on dayClick only in certain views

北城余情 提交于 2019-12-14 03:09:41

问题


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

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