首页 > 解决方案 > 仅在 dayGridMonth 中显示描述

问题描述

我需要使用extendedProps,但是当我尝试在timeGridWeek 或timeGridDay 中显示info.event.extendedProps.description 时,它不会(它说“未定义”),仅在dayGridMonth 中。我已阅读文档,但我不知道如何显示这些非标准属性。

事件显示正确。

(对不起我糟糕的英语)

<script>
      document.addEventListener('DOMContentLoaded', function() {
        var calendarEl = document.getElementById('calendar');

        var calendar = new FullCalendar.Calendar(calendarEl, {
          plugins: [ 'dayGrid', 'interaction', 'bootstrap', 'timeGrid', 'rrule' ],
          height: 'parent',
          header: {
            left: 'prev,next today',
            center: 'title',
            right: 'timeGridDay,timeGridWeek,dayGridMonth'
          },
          titleFormat: {
            year: 'numeric',
            month: 'long',
            day: '2-digit'
          },
          defaultView: 'timeGridWeek',
          themeSystem: 'bootstrap',
          selectable: true,
          editable: true,
          navLinks: true,
          weekNumbers: true,
          nowIndicator: true,
          locale: 'es',
          minTime: '08:00:00',
          maxTime: '22:00:00',
          weekends: false,
          eventOrder : 'color',
          eventSources: [
            'carga_citas.php',
            'carga_sesiones.php'
          ],
          eventClick: function(info) {
            alert(info.event.extendedProps.description);
          }
        });

        calendar.render();
      });
    </script>

感谢您的回复。

标签: fullcalendarfullcalendar-4

解决方案


推荐阅读