Users can categorize appointments by resources. The following example illustrates what resources are: in an educational center lectures are held in several rooms. In Scheduler terms, room is a resource kind, individual rooms are resource instances, and lectures are appointments that use these resource instances.
Use the resources array to define resource kinds. Each object in this array should contain at least the following fields:
Resource instances of this resource kind. Each instance should contain the
color fields. If your field names differ, specify them in the valueExpr, displayExpr, and colorExpr properties, respectively.
A data field used to assign instances of this resource kind to appointments. Add this field to appointment objects and set the field values to
id values of resource instances.
In this demo, the resources array contains three resource kinds: rooms, priorities, and assignees. Their fieldExpr values are
assigneeId, respectively. Each appointment contains the same fields. Field values assign the appointments to different instances of these resource kinds.
To use the color scheme of a specific resource kind, enable the kind's useColorAsDefault property. Otherwise, appointments use the color scheme of the last resource kind declared in the resources array.
This demo enables you to change the useColorAsDefault property at runtime. Click the radio buttons under the Scheduler to switch between different color schemes.
Each resource kind object can contain the allowMultiple property. When this property is set to true, users can assign multiple instances of this kind to a single appointment. In this demo, the Assignee resource kind allows multiple instances.
You can also group appointments by resources as shown in the following demo: Group Orientation.