Vue Timeline Resource Header Customization

The empty space above the resource list can be customized through the resourceHeader template. This a perfect place for filtering or headers in case of a resource grid and everything that helps the users in the context of the timeline.

Get started with this example

Demo

Loading the live demo

Preview in full screen

Add custom filters, labels, or contextual UI to Timeline resource headers — useful for room booking and resource scheduling views.

Code

<script setup>
import { getJson, MbscEventcalendar, setOptions  } from '@mobiscroll/vue'
import { onMounted, ref } from 'vue'

setOptions({
  locale:  ,
  theme: ' ',
  themeVariant: ' '
})

const myEvents = ref([])
const myResources = ref([
  {
    id: 1,
    name: 'Flatiron Room',
    seats: 90,
    color: '#fdf500'
  },
  {
    id: 2,
    name: 'The Capital City',
    seats: 250,
    color: '#ff0101'
  },
  {
    id: 3,
    name: 'Heroes Square',
    seats: 400,
    color: '#01adff'
  },
  {
    id: 4,
    name: 'Thunderdome',
    seats: 1200,
    color: '#239a21'
  },
  {
    id: 5,
    name: 'King’s Landing',
    seats: 550,
    color: '#ff4600'
  },
  {
    id: 6,
    name: 'Gathering Field',
    seats: 900,
    color: '#8f1ed6'
  }
])

const myView = {
  timeline: {
    type: 'week',
    startDay: 1,
    endDay: 5
  }
}

onMounted(() => {
  getJson(
    'https://trial.mobiscroll.com/daily-weekly-events/',
    (events) => {
      myEvents.value = events
    },
    'jsonp'
  )
})
</script>

<template>
  <MbscEventcalendar :clickToCreate="" :dragToCreate="" :dragToMove="" :dragToResize="" :eventDelete=""
    className="md-resource-header-template"
    :view="myView"
    :data="myEvents"
    :resources="myResources"
  >
    <template #resource="resource">
      <div class="md-resource-header-template-cont">
        <div class="md-resource-header-template-name">{{ resource.name }}</div>
        <div class="md-resource-header-template-seats">{{ resource.seats + ' seats' }}</div>
      </div>
    </template>
    <template #resourceHeader>
      <div class="md-resource-header-template-title">
        <div class="md-resource-header-template-name">Room</div>
        <div class="md-resource-header-template-seats">Capacity</div>
      </div>
    </template>
  </MbscEventcalendar>
</template>

<style>
.md-resource-header-template .mbsc-timeline-resource-col {
  width: 230px;
}

.md-resource-header-template .mbsc-timeline-resource-header,
.md-resource-header-template .mbsc-timeline-resource-title {
  padding: 0;
}

.md-resource-header-template .mbsc-timeline-resource-title {
  height: 100%;
}

.md-resource-header-template-cont {
  line-height: 50px;
  height: 100%;
}

.md-resource-header-template-name {
  height: 100%;
  display: inline-block;
  padding: 0 5px;
}

.md-resource-header-template-seats {
  border-left: 1px solid #ccc;
  width: 90px;
  height: 100%;
  float: right;
  padding: 0 5px;
}

.md-resource-header-template-title {
  font-weight: 600;
  line-height: 56px;
}
</style>

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.