MindFusion.Scheduling for JavaScript lets you associate resources with scheduled events via the resources, contacts, location and task properties of Item objects. These properties contain objects from the Resource, Contact, Location and Task classes respectively. If you need to assign a resource to schedule items, you must also add the resource to the appropriate collection in the Schedule class, namely resources, contacts, locations or tasks.
The following code creates a new Location and adds it to the location property of an existing schedule item. It also adds the location to the schedule.locations collection:
JavaScript Copy Code |
---|
var p = MindFusion.Scheduling; |
Timetable, List and Resource views let you display distinct rows or columns for selected resources and to group items by their associated resources. To enable that, add the resources of interest to the appropriate resource collection of the Calendar object (that is, resources, contacts, locations and tasks respectively) and set the calendar.groupType property to the appropriate value.
The following method imports the contacts aor tasks, depending on the group criteria, to the calendar:
JavaScript Copy Code |
---|
var p = MindFusion.Scheduling; function group(value) { |
The class Resource is the base class of Contact, Location and Task. It defines an Id property, which must be unique among all resources in the schedule, and serialization methods.
All calendar views provide means to filter out items, based on resources they contain. To see if there is any filtering or grouping enabled on the client, check the value of the groupType property.