Я хочу отключить событие dayclick - PullRequest
0 голосов
/ 15 апреля 2019

Я хочу отключить событие 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
  }
});

Ответы [ 2 ]

0 голосов
/ 16 апреля 2019

Просто удалите функциональный блок dayClick, если return false не работает

0 голосов
/ 16 апреля 2019

Это часть моего кода, и это отключает дневной клик

$("#datepicker").fullCalendar({
            header: {
                left:   'cbRefresh,prevYear,prev,next,nextYear,cbMonth',
                center: 'title',
                right:  '' //month,basicWeek,listWeek
            },
            height:             750,
            firstDay:           1,
            weekNumbers:        true,
            editable:           true,
            eventLimit:         true,
            defaultView:        'month',
            displayEventTime:   false,
            weekends:           uweekends,
            views:  {
                month:  {
                    eventLimit: 3
                }
            },
            dayClick: function(seldate,jsEvent,view) {
                //window.location.href=entryScreen+"?dt="+seldate.format();
                return false;
            },

return false , работает.Вы только что пытались удалить этот блок:

dayClick: function(seldate,jsEvent,view) {
                //window.location.href=entryScreen+"?dt="+seldate.format();
                return false;
            },

Одна вещь, которую нужно убедиться, для меня это имеет значение, это убедиться, что вы очищаете кеш после каждого изменения.

...