We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Get appointment owners from javascript

Hello!
I'm trying to pass appointment list of owners to an ajax function call.
I've extended the onAppointmentSaved(args) function but I don't know how to get the owners (in case of multiple resourses) of the saved appointment.
function onAppointmentSaved(args) {
var obj = $("#WorkSchedule").data("ejSchedule");
var owners = args.appointment.WorkSchedule_ownerfield_0;
$.ajax({
type: "POST",
dataType: 'json',
data: JSON.stringify(args.appointment),
contentType: 'application/json; charset=utf-8',
url: "../../Work/UpdateWork"
});
}
I found that the propertyIdOfSchedule_ownerfield_0contains a string with the ids of the owners. Is there another way to get the ids of the owners?
Thank you

3 Replies

KK Karthigeyan Krishnamurthi Syncfusion Team January 2, 2017 02:05 PM UTC

Hi Claudio, 
 
Thank you for contacting Syncfusion support. 
 
When an appointment is saved, respective owner id can be retrieved using OwnerId parameter and for the same we have prepared the below sample for your reference which can be download from the below location: 
 
Please let us know if you need further assistance. 
 
Regards, 
Karthigeyan 



CR CLAUDIO RICCARDI January 3, 2017 08:25 AM UTC

Hello Karthigeyan,

if I don't mistakee, OwnerId parameter contains a single id. If I specify more than one owner, can I use the same parameter for retreiving the list of owners?

Regards.

Claudio




KK Karthigeyan Krishnamurthi Syncfusion Team January 4, 2017 08:38 AM UTC

Hi Claudio,  
 
Thanks for your update. 
 
When an appointment is added for multiple resources (say 2), appointment objects (2) equal to the number of resources will be created for each resource as shown in the below images. If you wish to use OwnerId parameter then for-loop (based on appointment object length) can be used to retrieve the respective owner id’s or else args.appointment[0].Schedule1_ownerfield_0 (for without grouping) / args.appointment[0].Schedule1_ownerfield_1 (for with grouping) parameter can be used. 

Note: Schedule1_ownerfield_0/1 parameter will be available with all the owner id’s in all the appointment objects. It can be used to pass owner id in ajax call, since it is in sting format it needs to be split in ajax function.  

 


       

Regards, 
Karthigeyan 


Loader.
Up arrow icon