Skip to main content
A newer version of this page is available. .

ASPxClientScheduler.GetAppointmentProperties(aptId, propertyNames, onCallBack) Method

Enables obtaining appointment property values in a client-side script. Executes the callback command with the SchedulerCallbackCommandId.AppointmentData identifier.

Declaration

GetAppointmentProperties(
    aptId: string,
    propertyNames: string[],
    onCallBack: any
): string[]

Parameters

Name Type Description
aptId string

A string, representing the appointment ID.

propertyNames string[]

An array of strings, representing the appointment properties to query.

onCallBack any

A handler of a function which will receive and process the property values.

Returns

Type Description
string[]

An array of strings containing string representations of appointment properties.

Remarks

This method uses asynchronous callback to retrieve appointment property values.

For a use example, review the Appointments Selection online demo.

The GetAppointmentProperties is helpful within the ASPxClientScheduler.AppointmentsSelectionChanged event handler, as illustrated in the following code snippet, which displays the values of appointment properties in the specialized controls on the page:

function OnAppointmentsSelectionChanged(scheduler, appointmentIds) {
    if(appointmentIds != null && appointmentIds.length == 1) {
        scheduler.GetAppointmentProperties(appointmentIds[0], 'Subject;Location;Start;End;Description;ContactInfo', OnGetAppointmentProps);
    } else
        OnGetAppointmentProps(null);
}
function OnGetAppointmentProps(values) {
    var subj = document.getElementById('aptsubj');
    var loc = document.getElementById('aptloc');
    var start = document.getElementById('aptstart');
    var end = document.getElementById('aptend');
    var desc = document.getElementById('aptdesc');
    var contact = document.getElementById('aptcontact');
    if(values != null) {
        subj.innerHTML = values[0];
        loc.innerHTML = values[1];
        var formatter = new ASPx.DateFormatter();
        formatter.SetFormatString("dd.MM.yyyy HH:mm");
        start.innerHTML = formatter.Format(values[2]);
        end.innerHTML = formatter.Format(values[3]);
        desc.innerHTML = values[4];
        contact.innerHTML = (values[5] == null) ? "" : values[5];
    } else {
        var emptyStr = '&nbsp';
        subj.innerHTML = emptyStr;
        loc.innerHTML = emptyStr;
        start.innerHTML = emptyStr;
        end.innerHTML = emptyStr;
        desc.innerHTML = emptyStr;
        contact.innerHTML = emptyStr;
    }
}
See Also