New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

SchedulerAppointment Object

The SchedulerAppointment client-side object represents a single instance of an Appointment.

The tables below lists the most important, public properties of the SchedulerAppointment client-side object.

Properties

NameParametersReturn TypeDescription
get_allowDelete() set_allowDelete()NoneBooleanBooleanNoneGets or sets a Boolean value indicating whether the Appointment can be deleted.
get_allowEdit() set_allowEdit()NoneBooleanBooleanNoneGets or sets a Boolean value indicating whether the Appointment can be edited.
get_attributes()NoneSchedulerAttributeCollectionGets all Attributes of the Appointment.
get_backColor() set_backColor()NoneStringStringNoneGets or sets the backColor of the Appointment.
get_borderColor() set_borderColor()NoneStringStringNoneGets or sets the borderColor of the Appointment.
get_borderStyle() set_borderStyle()NoneStringStringNoneGets or sets the borderStyle of the Appointment.(Works only if the AppointmentStyleMode="Simple" )
get_borderWidth() set_borderWidth()NoneStringStringNoneGets or sets the borderWidth of the Appointment.(Works only if the AppointmentStyleMode="Simple" )
get_contextMenu()NoneContextMenuGets the ContextMenu of the Appointment. See Example 1.
get_cssClass() set_cssClass()NoneStringStringNoneGets or sets the cssClass of the Appointment.
get_description() set_description()NoneStringStringNoneGets or sets the description of the Appointment.
get_duration()NoneIntGets the duration of the Appointment in milliseconds.
get_durationInMinutes()NoneIntGets the duration of the Appointment in minutes.
get_element()NoneDomElementGets the DomElement representing the Appointment.
get_elements()NoneArray of DomElementsGets all DomElements that represent this appointment (for multi-part appointments)
get_end() set_end()NoneDateDateNoneGets or sets the end date of the Appointment.
get_id()NoneIntGets the ID of the Appointment
get_radScheduler()NoneRadSchedulerGets the owner Scheduler.
get_recurrenceParentID()NoneInt / undefinedGets the ID of the parent Appointment if the current Appointment is recurrent or 'undefined' otherwise.
get_recurrenceState()NoneTelerik.Web.UI.RecurrenceState or intGets the recurrence state of the Appointment. RecurrenceState can be: NotRecurring or 0, Master or 1, Occurrence or 2, Exception or 3
get_recurrenceRule()NoneStringGets the recurrence rule of the Appointment if it is "Master" and WebService binding is used or 'undefined' otherwise. See Example 2.
get_reminders()NoneTelerik.Web.UI.ReminderCollectionGets a collection of reminders for the Appointment
get_resources()NoneTelerik.Web.UI.SchedulerResourceCollectionGets a collection of resources for the Appointment
get_start() set_start()NoneDateDateNoneGets or sets the start date of the Appointment.
get_subject() set_subject()NoneStringStringNoneGets or sets the subject of the Appointment. The properties set_subject() , set_start() and set_end() will persist after postback. See Example 3.
get_selected() set_selected()NoneBooleanBooleanNoneGets or sets a Boolean value indicating whether the Appointment is selected.
get_timeSlot()NoneTimeSlotGets the asociated time slot object for the current Appointment.
get_toolTip() set_toolTip()NoneStringStringNoneGets or sets the ToolTip of the Appointment.
get_visible()NoneBooleanGets a Boolean value indicating whether the Appointment is visible.
_isAllDay()NoneBooleanGets a Boolean value indicating whether the Appointment's duration is all day or not.
clone()NoneAppointmentCreats a new Appointment that is copy of the instant one. See Example 4.

Example 1: Get the Appointment's ContextMenu.

JavaScript
	     
 function OnClientAppointmentClick(sender, args) {
	var contextMenu = args.get_appointment().get_contextMenu();
	contextMenu.show(args.get_domEvent());
}
				

Example 2: Gets the Appointment's recurrence rule.

JavaScript
	
function OnClientAppointmentClick(sender, args) {
	var appointment = args.get_appointment();
	appointment.set_allowEdit(true);
	var description = appointment.get_description();
	if (appointment.get_recurrenceState() == Telerik.Web.UI.RecurrenceState.NotRecurring) {
		appointment.set_description("This appointment is not recurring.");
	}
	else if (appointment.get_recurrenceState() == Telerik.Web.UI.RecurrenceState.Master) {
		var rrule = appointment.get_recurrenceRule();
		appointment.set_description(rrule);
	}
	else if (appointment.get_recurrenceState() == Telerik.Web.UI.RecurrenceState.Occurrence) {
		appointment.set_description("This is an occurence.");
	}
	else if (appointment.get_recurrenceState() == Telerik.Web.UI.RecurrenceState.Exception) {
		appointment.set_description("This is an exception.");
	}            
}      
	

Example 3: Set properties that will persist after postback.

JavaScript
	
function OnClientAppointmentClick(sender, args) 
{
	var appointment = args.get_appointment();
	var subject = appointment.get_subject();
	appointment.set_subject("new" + subject);
	var start = appointment.get_start();
	var newStart = new Date(start);
	newStart.setMinutes(newStart.getMinutes() - 45);
	app.set_start(newStart);
	var end = appointment.get_end();
	var newEnd = new Date(end);
	newEnd.setMinutes(newEnd.getMinutes() + 45);
	appointment.set_end(newEnd);
	sender.updateAppointment(appointment);
}      
	

The other setters can update the appointment in case of WebService binding where there is NO postback and the onClientAppointmentDataBound is fired.

JavaScript
	
function OnClientAppointmentDataBound(sender, args) 
{
	var appointment = args.get_appointment();
	appointment.set_backColor("red");
	appointment.get_attributes().setAttribute("Loacation", "Sofia");
	appointment.set_description("description");
	appointment.set_borderColor("red");
	appointment.set_borderStyle("dotted");
	appointment.set_borderWidth(1);
	appointment.set_allowDelete(false);
	appointment.set_allowEdit(false);

}    
	

Example 4: Create a copy Appointment.

JavaScript
	
function onClientAppointmentClick(sender, args)
{
	 var appointment = args.get_appointment();
	 var newAppointment = app.clone();
	 sender.insertAppointment(newAppointment);
}      
	

See Also

In this article
PropertiesSee Also
Not finding the help you need?
Contact Support