1

是否有任何特殊原因导致 selectMirror 不能在全日历中工作?没什么亮点!在我的控制台中加载我的脚本没有错误。

我的 eventRender、eventDrop、eventResize 和 select 函数中确实有很多脚本。他们都工作正常。如果我需要包括它们,我会的。我只是不确定这是否会根据 selectMirror 的设计方式引起冲突。

<link href="added-assets/plugins/fullcalendar-scheduler-4.1.0/packages/core/main.css" rel="stylesheet" />
<link href="added-assets/plugins/fullcalendar-scheduler-4.1.0/packages/daygrid/main.css" rel="stylesheet" />
<link href="added-assets/plugins/fullcalendar-scheduler-4.1.0/packages/timegrid/main.css" rel="stylesheet" />
<script src="added-assets/plugins/fullcalendar-scheduler-4.1.0/packages/core/main.js" type="text/javascript"></script>
<script src="added-assets/plugins/fullcalendar-scheduler-4.1.0/packages/interaction/main.js" type="text/javascript"></script>
<script src="added-assets/plugins/fullcalendar-scheduler-4.1.0/packages/daygrid/main.js" type="text/javascript"></script>
<script src="added-assets/plugins/fullcalendar-scheduler-4.1.0/packages/timegrid/main.js" type="text/javascript"></script>

<script src="added-assets/plugins/fullcalendar-scheduler-4.1.0/packages/resource-common/main.js" type="text/javascript"></script>
<script src="added-assets/plugins/fullcalendar-scheduler-4.1.0/packages/resource-daygrid/main.js" type="text/javascript"></script>
<script src="added-assets/plugins/fullcalendar-scheduler-4.1.0/packages/resource-timegrid/main.js" type="text/javascript"></script>


<script>
document.addEventListener('DOMContentLoaded', function() {
 var calendar_full = document.getElementById('calendar_full');
    var calendar = new FullCalendar.Calendar(calendar_full, {
        selectMirror: true,
        selectable: true,
        editable: true,
        plugins: ['interaction', 'resourceDayGrid', 'resourceTimeGrid'],
        header: {
            right: 'prevYear,prev,next,nextYear,today',
            left: 'title',
            center: 'resourceTimeGridDay,resourceTimeGridWeek,resourceDayGridMonth'
        },
        defaultView: 'resourceTimeGridWeek',
        slotDuration: "<?php echo $location->data()->calendar_slot_duration; ?>",
        snapDuration: "<?php echo $location->data()->calendar_snap_duration; ?>",
        nowIndicator: true,
        minTime: "<?php echo $location->data()->calendar_start; ?>",
        maxTime: "<?php echo $location->data()->calendar_end; ?>",
        hiddenDays: $.parseJSON('[' + "<?php echo $location->data()->calendar_hide_days_of_week; ?>" + ']'),
        groupByResource: true,
        eventLimit: true,
        schedulerLicenseKey: 'CC-Attribution-NonCommercial-NoDerivatives',
        events: {
            url: 'ajax_get_json.php?what=location_appointments'
        },
        resources: {
            url: "ajax_get_json.php?what=schedule_providers_at_location"
        },
        resourceRender: function(renderInfo) {

            var default_provider = "<?php echo $default_provider; ?>";

            if (default_provider) {

                //change color of resource to match selected contact assigned to provider
                if (renderInfo.resource.id == default_provider) {
                    renderInfo.el.style.backgroundColor = 'rgb(233,237,239)';
                }

            }

        },
        dateClick: function(info) {
            if (info.view.type === "resourceDayGridMonth") {
                calendar.gotoDate(info.date);
                calendar.changeView('resourceTimeGridWeek');
            }
        },
        loading: function(bool) {
            if (bool) {
                $('.loader').show();
                $('#show_cancelled_appts').hide();
                $('#show_rescheduled_appts').hide();
            } else {
                $('.loader').hide();
                $('#show_cancelled_appts').show();
                $('#show_rescheduled_appts').show();
            }
        },
        datesRender: function(info) {


            if (info.view.type === "resourceDayGridMonth") {
                var date = calendar.getDate();
                var b = date.toISOString();

                calendar_mini.gotoDate(b);

            }
        }
    });
    calendar.render();

当我从版本 3 迁移时,我的脚本中的所有内容都运行良好,但是选择镜像。我不知道 selectMirror 的作用:我有正确的插件/css 吗?

关于如何解决这个问题的任何建议?

4

1 回答 1

1

我想通了。不确定这是否会在未来对其他人有所帮助,但我了解到 eventRender 与 selectMirror 结合使用。我的 eventRender 中有一行代码阻止了镜子的显示。一旦我编辑了我的代码,镜像就会正确显示。

于 2019-05-04T01:40:23.917 回答