ig.scheduler.ScheduleDataSource
Remarks
ScheduleDataSource provides the ability to bind the Scheduler to a source of data from which Appointment and ScheduleResource objects can be created, updated, and deleted.
Use the ScheduleDataSource.getAppointmentsInRange method to obtain a subset of Appointment objects which lie in a specific date range.
To update an existing Appointment object, call the ScheduleDataSource.beginEdit method to begin the edit session, and the ScheduleDataSource.endEdit method to commit changes made to the object.
Similarly, a new Appointment can be created by calling the ScheduleDataSource.createAppointment method, followed by a call to EndEdit to commit the changes.
To delete an existing Appointment, use the ScheduleDataSource.deleteAppointment method.
Because the ScheduleDataSource class supports asynchronous interaction with a data source, the create/read/update/delete related methods return an object from which the data can be obtained synchronously or asynchronously, depending on the derived class implementation.
The ScheduleListDataSource class provides a concrete implementation of ScheduleDataSource, for synchronous access to a locally stored data source. See documentation of that class for details.
Dependencies
-
ig.scheduler.ScheduleDataSource
Constructor- new $.ig.scheduler.ScheduleDataSource( );
Creates a new instance.
-
beginEdit
- .beginEdit( appointment:ig.scheduler.Appointment, errorCallback:function );
- Return Type:
- boolean
- Return Type Description:
- True if the operation was successful.
Begins an edit mode session on the specified activity.
- appointment
- Type:ig.scheduler.Appointment
- The Appointment to be edited.
- errorCallback
- Type:function
-
bumpResourcesVersion
- .bumpResourcesVersion( );
Marks the resources cache dirty.
-
cancelEdit
- .cancelEdit( appointment:ig.scheduler.Appointment );
- Return Type:
- ig.scheduler.AppointmentOperationResult
- Return Type Description:
- An AppointmentOperationResult instance containing the result of the operation.
Reverses changes made to an Appointment during an edit mode session initiated by the ScheduleDataSource.beginEdit or ScheduleDataSource.createAppointment methods.
- appointment
- Type:ig.scheduler.Appointment
- The Appointment being edited.
-
createAppointment
- .createAppointment( errorCallback:function );
- Return Type:
- ig.scheduler.Appointment
- Return Type Description:
- A reference to the new Appointment or null if the operation fails. To receive detailed information about the reson the operation failed, a delegate must be assigned to the errorCallback parameter.
When overridden in a derived class, creates a new Appointment.
- errorCallback
- Type:function
Remarks
The CreateAppointment method returns a new, uninitialized Appointment instance. This appointment is not associated with the data source until the ScheduleDataSource.endEdit method is called; as such, it will not appear in activity queries or in the user interface of an attached Scheduler.
Note that the ScheduleDataSource.endEdit method must be called to commit the creation of the new appointment.
Also note that the underlying item source for appointment data must support creation of new objects. Typically this requires that the object expose a parameterless constructor. Derived classes may provide alternative means through which a new data object instance can be created.
-
createVariance
- .createVariance( appointment:ig.scheduler.Appointment );
Creates a variance, i.e., a modified occurrence of a recurrence.
- appointment
- Type:ig.scheduler.Appointment
-
dataErrorCallback
- .dataErrorCallback( );
Returns a delegate which is called when an error is encountered during interaction with the dataSource.
-
dataErrorCallback
- .dataErrorCallback( value:function );
Sets a delegate which is called when an error is encountered during interaction with the dataSource.
- value
- Type:function
-
deleteAppointment
- .deleteAppointment( appointment:ig.scheduler.Appointment );
- Return Type:
- ig.scheduler.AppointmentOperationResult
- Return Type Description:
- An AppointmentOperationResult instance which contains the result of the operation.
When overridden in a derived class, deletes the specified Appointment.
- appointment
- Type:ig.scheduler.Appointment
- The appointment to be deleted.
Remarks
The DeleteAppointment method removes an existing Appointment instance, and causes it to become disassociated from the data source. After a successful deletion, the Appointment no longer appears in activity queries or in the user interface.
Note that the underlying item source for appointment data must support removal of items.
-
destroy
- .destroy( );
When implemented in a derived class, performs any cleanup operations necessary in order to release memory previously used by this object.
-
endEdit
- .endEdit( appointment:ig.scheduler.Appointment, force:boolean );
- Return Type:
- ig.scheduler.AppointmentOperationResult
- Return Type Description:
- An AppointmentOperationResult instance containing the result of the operation.
Commits changes made to an ActivityBase during an edit mode session initiated by the ScheduleDataSource.beginEdit or ScheduleDataSource.createAppointment methods.
- appointment
- Type:ig.scheduler.Appointment
- The Appointment being edited.
- force
- Type:boolean
- True to force exiting of edit mode.
-
getAppointmentBackgroundColor
- .getAppointmentBackgroundColor( resource:ig.scheduler.ScheduleResource );
- Return Type:
- string
- Return Type Description:
- The resolved color in hexadecimal format.
Returns the resolved Appointment background color for the specified ScheduleResource.
- resource
- Type:ig.scheduler.ScheduleResource
- The ScheduleResource to test.
-
getAppointmentsInRange
- .getAppointmentsInRange( range:ig.scheduler.DateTimeRange );
- Return Type:
- ig.scheduler.AppointmentQueryResult
- Return Type Description:
- An AppointmentQueryResult object containing the result of the query.
Returns all appointments which lie within the specified date/time range.
- range
- Type:ig.scheduler.DateTimeRange
- The range of time for which the appointments are to be returned.
Remarks
Note that this method returns all appointments in the specified range, regardless of which ScheduleResource the appointment may be associated with.
Use the ScheduleDataSource.getAppointmentsInRange overload to filter the returned appointment list by one or more ScheduleResource.
See Also
-
getAppointmentsInRange
- .getAppointmentsInRange( range:ig.scheduler.DateTimeRange, resources:ig.IEnumerable`1 );
- Return Type:
- ig.scheduler.AppointmentQueryResult
- Return Type Description:
- An AppointmentQueryResult object containing the result of the query.
When overridden in a derived class, returns the appointments which lie within the specified date/time range, optionally filtering by one or more resources.
- range
- Type:ig.scheduler.DateTimeRange
- The range of time for which the appointments are to be returned.
- resources
- Type:ig.IEnumerable`1
- Optional list of resources on which to filter. If a non-null value is specified, only appointments which belong to one of the specified resources is returned.
See Also
-
getAppointmentTextColor
- .getAppointmentTextColor( resource:ig.scheduler.ScheduleResource );
- Return Type:
- string
- Return Type Description:
- The resolved color in hexadecimal format.
Returns the resolved Appointment text color for the specified ScheduleResource.
- resource
- Type:ig.scheduler.ScheduleResource
- The ScheduleResource to test.
-
getResources
- .getResources( );
Returns an enumerable list of the resources associated with this data source.
Remarks
A ScheduleResource provides the ability to group Appointment data; activity queries can filter by a resource to limit the query result so that only appointments associated with a given resource are returned.
The manner in which resources are associated with the data source is dependent on the derived class implementation; for example, ScheduleListDataSource exposes a ScheduleListDataSource.resourceItemsSource property through which an item source for the resource data can be defined.
-
hasAppointmentsInRange
- .hasAppointmentsInRange( range:ig.scheduler.DateTimeRange, resources:ig.IEnumerable`1, findFirst:boolean );
- Return Type:
- ig.scheduler.DateQueryResult
- Return Type Description:
- A DateQueryResult object containing the result of the query.
Returns an array of dates representing the days in the given date/time range which contain appointments.
- range
- Type:ig.scheduler.DateTimeRange
- The range of time to test.
- resources
- Type:ig.IEnumerable`1
- Optional list of resources on which to filter. If a non-null value is specified, only appointments which belong to one of the specified resources is returned.
- findFirst
- Type:boolean
- If true the query terminates as soon as it encounters activity in the given range. Use this if you are not interested in which dates have activity, only whether each date in the specified range contains any activity at all.
Remarks
The HasAppointmentsInRange
See Also
-
internalNotifyPropertyChanging
- .internalNotifyPropertyChanging( activity:ig.scheduler.ActivityBase, propertyName:string, oldValue:object, newValue:object );
- Return Type:
- boolean
- Return Type Description:
- True to allow the notification, false to suppress it.
Called before an internal property change notification is handled, giving the data source an opportunity to suppress the notification.
- activity
- Type:ig.scheduler.ActivityBase
- The ActivityBase instance
- propertyName
- Type:string
- The name of the property whose value is changing.
- oldValue
- Type:object
- The property value before the change is made.
- newValue
- Type:object
- The property value after the change is made.
-
isAppointmentDataReady
- .isAppointmentDataReady( );
Returns false in the case where an appointment item source has been assigned and the initialization process is currently underway.
-
onAppointmentPropertyChanged
- .onAppointmentPropertyChanged( appointment:ig.scheduler.Appointment, property:ig.scheduler.AppointmentProperty, oldValue:object, newValue:object, [raiseEvent:boolean] );
Raises the AppointmentPropertyChanged event.
- appointment
- Type:ig.scheduler.Appointment
- property
- Type:ig.scheduler.AppointmentProperty
- oldValue
- Type:object
- newValue
- Type:object
- raiseEvent
- Type:boolean
- Optional
-
onPropertyChanged
- .onPropertyChanged( propertyName:string );
Raises the PropertyChanged event.
- propertyName
- Type:string
-
onResourcePropertyChanged
- .onResourcePropertyChanged( resource:ig.scheduler.ScheduleResource, property:ig.scheduler.ScheduleResourceProperty, dayOfWeek:ig.DayOfWeek );
Raises the ResourcePropertyChanged event.
- resource
- Type:ig.scheduler.ScheduleResource
- property
- Type:ig.scheduler.ScheduleResourceProperty
- dayOfWeek
- Type:ig.DayOfWeek