【问题标题】:FullCalenday Clicking Day change to Agenda View of that particular dateFullCalenday 点击日更改为特定日期的议程视图
【发布时间】:2015-01-15 10:44:41
【问题描述】:

我正在完整日历中显示月份视图。当我在月视图中单击一天时,它应该显示该特定日期的日/议程视图。

下面是代码 - 但它显示的是当前的议程视图,而不是点击的那个。

dayClick: function(date, allDay, jsEvent, view) {

      if (allDay) {
        // Clicked on the entire day
        $('#calendar')
        .fullCalendar('changeView', 'agendaDay'/* or 'basicDay' */)
        .fullCalendar('gotoDate', date.getFullYear(), date.getMonth(), date.getDate());
      }

    },

【问题讨论】:

    标签: javascript jquery plugins fullcalendar


    【解决方案1】:

    这就是我做这件事的方法:

    dayClick: function(date, jsEvent, view) {
      if(view.name == 'month' || view.name == 'basicWeek') {
        $('#calendar').fullCalendar('changeView', 'basicDay');
        $('#calendar').fullCalendar('gotoDate', date);      
      }
    }
    

    代码编辑

    【讨论】:

    • 更改订单 gotoDate 和 ChangeView 让它在我的代码上为我工作
    【解决方案2】:

    对于版本 4 是这样的:

    dateClick: function(info) {
        if(info.view.type=="dayGridMonth"){
            this.changeView("timeGridDay",info.dateStr);
        }
      }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-13
      • 2014-05-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多