jquery - dayClick 无法正常工作全日历

标签 jquery calendar fullcalendar

我试图从 dayClick 获得一些响应,但是当我点击那里时,没有任何反应。我在下面给出了我的代码。

    $('.full_calendar').fullCalendar({
    header: {
      left: 'prev,next, today',
      center: 'title',
      right: 'month,agendaWeek,agendaDay,listWeek',
    },
    defaultDate: '2018-03-12',
    navLinks: true, // can click day/week names to navigate views
    editable: true,
    eventLimit: true, // allow "more" link when too many events
    events: [{"title":"Email","start":"2018-03-21","className":"background_f05050","calender_type":0,"lifecycle_todo_id":31},{"title":"Personal Call","start":"2018-03-23","className":"background_5c9bec","calender_type":0,"lifecycle_todo_id":11},{"title":"Personal Call","start":"2018-03-23","className":"background_5c9bec","calender_type":0,"lifecycle_todo_id":17},{"title":"Personal Call","start":"2018-03-29","className":"background_f05050","calender_type":0,"lifecycle_todo_id":33},{"title":"Personal Call","start":"2018-05-03","className":"background_5c9bec","calender_type":0,"lifecycle_todo_id":12},{"title":"Personal Call","start":"2018-05-03","className":"background_5c9bec","calender_type":0,"lifecycle_todo_id":18},{"title":"Personal Call","start":"2018-05-06","className":"background_5c9bec","calender_type":0,"lifecycle_todo_id":30},{"title":"Email","start":"2018-05-08","className":"background_f05050","calender_type":0,"lifecycle_todo_id":32},{"title":"Personal Call","start":"2018-05-09","className":"background_f05050","calender_type":0,"lifecycle_todo_id":34},{"title":"Follow Up","start":"2018-03-13","className":"background_f05050","prospect_no":"381299717","note_id":2,"calender_type":1},{"title":"Follow Up","start":"2018-03-19","className":"background_f05050","prospect_no":"873529032","note_id":7,"calender_type":1},{"title":"Follow Up","start":"2018-03-24","className":"background_f05050","prospect_no":"873529032","note_id":8,"calender_type":1},{"title":"Follow Up","start":"2018-03-22","className":"background_f05050","prospect_no":"873529032","note_id":14,"calender_type":1}],
    selectable: true,
    eventClick: function(calEvent, jsEvent, view) {
      var result = '';
      switch(calEvent.calender_type){
        case 0: {
          fetchlifecycletododata(calEvent.lifecycle_todo_id);
          break;
        };

        case 1: {
          fetchnotesdata(calEvent.note_id);
          break;
        };
      }

    },
    dayClick: function(date, jsEvent, view) {
      console.log('hi');
    },
  });

它正在 jsfidddle 中工作,但不在我的 Html 中。 ??

最佳答案

link 的帮助下我找到了问题的解决方案。并且还写在下面。

在我包含完整的日历 CSS 之前,如下所示

<link href="/css/vendor/fullcalendar.min.css" rel="stylesheet" />
<link href="/css/vendor/fullcalendar.print.css" rel="stylesheet" />

我只是在

中添加 media="print"标签
 <link href="/css/vendor/fullcalendar.print.css" media="print" rel="stylesheet" />

我的问题已经解决了。

关于jquery - dayClick 无法正常工作全日历,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49442707/

相关文章:

javascript - 禁用默认功能jquery

css - 在 Rails 中计算日历一个月中的周数

java - 类的另一个对象的行为不同,JavaSource_Calendar 类

jquery - fullCalendar v1.5.1 - ie7 和 ie8 - SCRIPT5007

jQuery Slider IE 问题(不工作)

html - 隐藏特定的div onload,然后在点击后显示div

javascript - 子菜单在菜单单击时保持打开状态

Android 日历提供商同步 - SYNC_DATA 列?

javascript - 限制全日历中每天创建的事件数

fullcalendar backgroundColor 属性