полный календарь-планировщик, чтобы не добавлять отдельные комнаты

Я использовал свой университетский проект для full-calendar. Календарь работает нормально, но у меня какая-то проблема, я хочу знать, как добавить некоторые комнаты (посмотрите мое прикрепленное изображение). Я пытаюсь добавить, но они перекрываются, пожалуйста, помогите мне исправить это введите здесь описание изображения Я добавил resourceLabelText: 'Rooms2', не отображать , посмотрите, я рисую свою проблему в прикрепленном изображении. Это мой код.

 <script>

    $(function() { // document ready

        $('#calendar').fullCalendar({
            now: '2017-12',
            editable: true, // enable draggable events
            aspectRatio: 1.8,
            scrollTime: '00:00', // undo default 6am scrollTime
            header: {
                left: 'today prev,next',
                center: 'title',
                right: 'timelineThreeDays'
            },
            defaultView: 'timelineThreeDays',
            views: {
                timelineThreeDays: {
                    type: 'timeline',
                    duration: { days: 31 }
                }
            },
            resourceLabelText: 'Rooms',

            resources: [
                { id: 'a', title: 'Auditorium A' },
                { id: 'b', title: 'Auditorium B', eventColor: 'green' },
                { id: 'c', title: 'Auditorium C', eventColor: 'orange' },
                { id: 'd', title: 'Auditorium D', children: [

                ] },
                { id: 'e', title: 'Auditorium E' },
                { id: 'f', title: 'Auditorium F', eventColor: 'red' },
                { id: 'g', title: 'Auditorium G' },
                { id: 'h', title: 'Auditorium H' },

            ],
            events: [

                // background event, associated with a resource
                //{ id: 'bg1', resourceId: 'b', rendering: 'background', start: '2017-11-07', end: '2017-11-10' },

                // background event, NOT associated with a resource
                //{ id: 'bg2', rendering: 'background', start: '2017-11-07', end: '2017-11-07' },

                // normal events...
                { id: '6', resourceId: 'g', start: '2017-11-07', end: '2017-11-08', title: 'event 1' },
                { id: '7', resourceId: 'h', start: '2017-11-09', end: '2017-11-12', title: 'event 2' },
                { id: '8', resourceId: 'i', start: '2017-11-11', end: '2017-11-15', title: 'event 3' },
                { id: '9', resourceId: 'j', start: '2017-11-17', end: '2017-11-19', title: 'event 4' },
                { id: '10', resourceId: 'k', start: '2017-11-27', end: '2017-11-28', title: 'event 5' }
            ],
            resourceLabelText: 'Rooms2',

            resources: [
                { id: 'g', title: 'Auditorium G' },
                { id: 'h', title: 'Auditorium H', eventColor: 'green' },
                { id: 'i', title: 'Auditorium I', eventColor: 'orange' },
                { id: 'j', title: 'Auditorium J', children: [

                ] },
                { id: 'e', title: 'Auditorium E' },
                { id: 'f', title: 'Auditorium F', eventColor: 'red' },
                { id: 'g', title: 'Auditorium G' },
                { id: 'h', title: 'Auditorium H' },

            ],
            events: [

                // background event, associated with a resource
                //{ id: 'bg1', resourceId: 'b', rendering: 'background', start: '2017-11-07', end: '2017-11-10' },

                // background event, NOT associated with a resource
                //{ id: 'bg2', rendering: 'background', start: '2017-11-07', end: '2017-11-07' },

                // normal events...
                { id: '1', resourceId: 'b', start: '2017-11-07', end: '2017-11-08', title: 'event 1' },
                { id: '2', resourceId: 'c', start: '2017-11-09', end: '2017-11-12', title: 'event 2' },
                { id: '3', resourceId: 'd', start: '2017-11-11', end: '2017-11-15', title: 'event 3' },
                { id: '4', resourceId: 'e', start: '2017-11-17', end: '2017-11-19', title: 'event 4' },
                { id: '5', resourceId: 'f', start: '2017-11-27', end: '2017-11-28', title: 'event 5' }
            ]





        });


    });

</script>

person core114    schedule 12.12.2017    source источник
comment
вы, кажется, дважды определяете события и ресурсы и resourceLabelText. Я почти уверен, что это не сработает должным образом. FullCalendar ожидает, что каждый параметр будет определен один раз, иначе он не будет знать, какую версию использовать. Вы также, похоже, определили некоторые ресурсы (например, g и h) несколько раз. Идентификаторы должны быть уникальными, иначе fullCalendar не будет знать, какой ресурс какой при добавлении событий. Если вы хотите разделить их на две части (например, комнаты и комнаты2), используйте группировку ресурсов (см. демонстрацию по адресу fullcalendar.io/js/fullcalendar-scheduler-1.9.0/demos/)   -  person ADyson    schedule 12.12.2017
comment
@ADyson Сэр, у меня снова работает. Спасибо за ссылку.   -  person core114    schedule 14.12.2017