0

I need to create a new row grouping the header columns that are similar to each other I've tried using resourceColumns and resourceGroupField, neither has had success. Perhaps I'm not making a good use of them.

<script>
  document.addEventListener('DOMContentLoaded', function() {
    var calendarEl = document.getElementById('calendar');
    var calendar = new FullCalendar.Calendar(calendarEl, {
      schedulerLicenseKey: 'GPL-My-Project-Is-Open-Source',
      plugins: ['resourceTimeGrid'],
      resourceGroupField: 'building',
      defaultView: 'resourceTimeGridDay',
      resourceColumns: [{
          group: true,
          labelText: 'Fabrica',
          field: 'building'
        },
        {
          labelText: 'Doca',
          field: 'title'
        }
      ],

      resources: [{
          id: 'a',
          title: 'R16-1',
          building: 'P16'
        },
        {
          id: 'b',
          title: 'R16-2',
          building: 'P16'
        },
        {
          id: 'c',
          title: 'R16-3',
          building: 'P16'
        },
        {
          id: 'd',
          title: 'R16-4',
          building: 'P16'
        },
        {
          id: 'e',
          title: 'R19-1',
          building: 'P19'
        },
        {
          id: 'f',
          title: 'R27-1',
          building: 'P27'
        },
        {
          id: 'g',
          title: 'R27-2',
          building: 'P27'
        },
        {
          id: 'h',
          title: 'R27-3',
          building: 'P27'
        },
        {
          id: 'i',
          title: 'R27-4',
          building: 'P27'
        },
        {
          id: 'j',
          title: 'R27-5',
          building: 'P27'
        },
        {
          id: 'k',
          title: 'R40-1',
          building: 'p40'
        },
        {
          id: 'l',
          title: 'R54-1',
          building: 'P54'
        },
        {
          id: 'm',
          title: 'R56-1',
          building: 'P56'
        },
        {
          id: 'n',
          title: 'R56-2',
          building: 'P56'
        },
      ],
      nowIndicator: true,
    });

    calendar.render();
  });
</script>
ADyson
  • 57,178
  • 14
  • 51
  • 63
Sheng Hiu
  • 11
  • 2

0 Answers0