ProSchedulerSign in

Timeline · Configuring the view

Event order

With eventOrder, urgent jobs take the top lane of each technician's row, whatever time they start.

Live demo

Drag a low-priority job over an urgent one

Fullscreen
import { ProScheduler } from "@andreisaac/pro-scheduler"
import { priorityColors, technicians, workOrders, type WorkOrder } from "./data/operations"
import { useEvents } from "./kit"

const rank = { Urgent: 0, Normal: 1, Low: 2 }

export function TimelineEventOrderDemo() {
  const { events, handlers } = useEvents(() =>
    workOrders().map((w) => ({ ...w, color: priorityColors[w.priority] })),
  )
  // Urgent jobs take the top lane of each technician's row.
  return (
    <ProScheduler
      data={events}
      resources={technicians}
      view={{ timeline: { type: "week", resolutionHorizontal: "hour", startTime: "07:00", endTime: "19:00" } }}
      eventOrder={(a, b) => rank[(a as WorkOrder).priority] - rank[(b as WorkOrder).priority]}
      styleConfig={{ unitWidthPx: 26, fitToWidth: false }}
      height={480}
      {...handlers}
    />
  )
}

About this demo

With eventOrder, urgent jobs take the top lane of each technician's row, whatever time they start.

Things to try

  • Drag a low-priority job over an urgent one

The props behind it are explained in Recurrence, time zones and order.

Use ProScheduler in your project