Data Binding
The Kendo UI Scheduler for Angular accepts an array of SchedulerEvent
objects through the events
attribute of the <kendo-scheduler>
tag.
When you bind the Scheduler to data, note the following specifics:
- When the data is received from an asynchronous source, pipe it through the
async
pipe. - Dates have to be represented by instances of the JavaScript
Date
object which ensures their correct handling and formatting.
Using Built-In Directive
The built-in kendoSchedulerBinding
directive filters events that are out of range and expands the recurring series in-memory.
Using Manual Binding
You can bind events by directly using the events
attribute of the Scheduler. This binding mode is useful for skipping the built-in recurrence engine and using an alternative—for example, a server-side solution.
Binding to Models
By default, the Scheduler accepts an array of SchedulerEvent
objects as data. To bind the component to custom objects, bind a model field map to the modelFields
property.
Using the dateChange Event
The dateChange
event fires each time the current date range changes which allows the supply of the event data in smaller chunks that cover only the currently visible time period.
The
dateChange
event does not necessarily fire when the views get switched—for example, an Agenda and a Week view might cover the same date range.
Resource Binding
An event can have one or more "resources" assigned to it—for example, a meeting room or a guest list. To configure the Scheduler to display each resource as a sub-view, refer to the section on grouping by resource.
Each resource is described by a Resource
object that contains all possible values for it. To define resources, set the resources
attribute.
As a minimum, you have to define the following fields:
field
—The field name of the event that contains the resource value.data
—The resource data array.valueField
—The field name from the data that contains the value of the resource.textField
—The field name from the data that contains the text of the resource.