我想禁用dayclick事件

问题描述 投票:0回答:2

我想禁用dayClick事件。在select事件之后,dayClick事件总是开火。我想阻止它。我可以禁用dayClick事件吗?

$(function() {
$('#calendar').fullCalendar
({
  defaultView: 'agendaDay',
  defaultDate: '2018-04-07',
  editable: true,
  selectable: true,
  eventLimit: true, // allow "more" link when too many events
  header: {
    left: 'prev,next today',
    center: 'title',
    right: 'agendaDay,agendaTwoDay,agendaWeek,month'
  },
  views: {
    agendaTwoDay: {
      type: 'agenda',
      duration: { days: 2 },
      groupByResource: true
    }
  },

  resources: [
    { id: 'a', title: 'Room A' },
    { id: 'b', title: 'Room B', eventColor: 'green' },
    { id: 'c', title: 'Room C', eventColor: 'orange' },
  ],
  events: [
    { id: '1', resourceId: 'a', start: '2018-04-06', end: '2018-04-08', title: 'event 1' },
  ],

  select: function(start, end, jsEvent, view, resource) {
    alert("select");
  },

  dayClick: function(date, jsEvent, view, resource) {
    alert("dayClick");
    return false;//not work
    //jsEvent.preventDefault();//not work
    //$('#calendar').fullCalendar('unselect');//not work
  }
});
jquery fullcalendar fullcalendar-scheduler
2个回答
© www.soinside.com 2019 - 2024. All rights reserved.