Resource Row Styling

Easily highlight rows by adding a simple background color or craft a more specific look with the cssClass property of the resources data.

The output could be a custom background to individual rows and it can be used for multiple purposes. For example:

  • Changing the background color for parent and child resources, like different color for different levels.
  • Different styling for certain rows, like thicker border acting as separator.
  • Resource selection, where the selected resource has a different background.
  • Setting different backgrounds for the resource titles/grid rows/sidebar
Interested in highlighting date ranges only?  Explore this example →
Download and try example

Demo

Loading the live demo

Preview in full screen

Highlight resource rows on a Timeline using background colors or CSS classes — differentiate teams, show status, or style headers and grid sections.

Code

mobiscroll.setOptions({
  locale:  ,
  theme: ' ',
  themeVariant: ' '
});

mobiscroll.eventcalendar('#demo-resource-background', {
  clickToCreate:  ,
  dragToCreate:  ,
  dragToMove:  ,
  dragToResize:  ,
  eventDelete:  ,
  view: {
    timeline: {
      type: 'month',
    },
  },
  resources: [
    {
      id: 1,
      name: 'Resource A - Row background with "background" property',
      color: '#e20000',
      background: 'rgba(108, 166, 166, 0.37)',
    },
    {
      id: 2,
      name: 'Resource B - Thicker borders with "cssClass" property',
      color: '#1dab2f',
      cssClass: 'md-tick-border',
    },
    {
      id: 3,
      name: 'Resource C',
      color: '#4981d6',
    },
    {
      id: 4,
      name: 'Resource D - Resource background with "cssClass" property',
      color: '#e25dd2',
      cssClass: 'md-resource-only-bg',
    },
    {
      id: 5,
      name: 'Resource E - Different backgrounds with "cssClass" property',
      color: '#4981d6',
      cssClass: 'md-diff-custom-bg',
    },
    {
      id: 6,
      name: 'Resource F',
      color: '#d6d145',
    },
    {
      id: 7,
      name: 'Resource H - Grid background with "cssClass" property',
      color: '#34c8e0',
      cssClass: 'md-row-only-bg',
    },
  ],
  data: [
    {
      start: '2026-10-02T00:00',
      end: '2026-10-05T00:00',
      title: 'Event 1',
      resource: 1,
    },
    {
      start: '2026-10-10T09:00',
      end: '2026-10-15T15:00',
      title: 'Event 2',
      resource: 3,
    },
    {
      start: '2026-10-12T00:00',
      end: '2026-10-14T00:00',
      title: 'Event 3',
      resource: 4,
    },
    {
      start: '2026-10-15T07:00',
      end: '2026-10-20T12:00',
      title: 'Event 4',
      resource: 5,
    },
    {
      start: '2026-10-03T00:00',
      end: '2026-10-10T00:00',
      title: 'Event 5',
      resource: 6,
    },
    {
      start: '2026-10-10T08:00',
      end: '2026-10-11T20:00',
      title: 'Event 6',
      resource: 7,
    },
  ],
  renderSidebar: function (resource) {
    return '<div class="md-resource-bg-res-cont">' + resource.name + ' Sidebar</div>';
  },
});
  

Duplicate Session

You have signed in on a different machine. To keep everything in sync, you have been signed out of this session.

If you need to invite team members, manage seats and accounts you can do it from the licenses page.

Duplicate Session

We noticed you are logged in on a different machine and have closed your old session.

If you need to invite team members, manage seats and accounts you can do it from the licenses page.