Hi,
I'm using the scheduler control in TimelineView only. I set the following custom attributes on resources server side in the OnDataBound event, example:
These are the start time and end time of each individual resource's working hours, and are in my code loaded from a database. These attributes are used server side in the OnTimeSlotCreated event successfully.
In my application, I need to check if an appointment is moved outside of the resource's working hours, and then display a javascript alert warning the user from the OnClientAppointmentMoveEnd event.
From my JavaScript, if I attemp the following I am able to retrive the attributes correctly:
I'm using the scheduler control in TimelineView only. I set the following custom attributes on resources server side in the OnDataBound event, example:
resource.Attributes.Add("StartTime", "08:00");
resource.Attributes.Add("EndTime", "16:00");
These are the start time and end time of each individual resource's working hours, and are in my code loaded from a database. These attributes are used server side in the OnTimeSlotCreated event successfully.
In my application, I need to check if an appointment is moved outside of the resource's working hours, and then display a javascript alert warning the user from the OnClientAppointmentMoveEnd event.
From my JavaScript, if I attemp the following I am able to retrive the attributes correctly:
var startTime = scheduler.get_resources().getResource(0).get_attributes().getAttribute("StartTime");
If I attempt to retrieve the attributes from the event arguments using the following code, the attributes don't exist:
var startTime = eventArgs.get_targetSlot().get_resource().get_attributes().getAttribute("StartTime");
If I call the following function, I am able to get the resource correctly, it's just the attributes that are blank:
var
resource = eventArgs.get_targetSlot().get_resource();
Is there any way i can retrive my resource attributes successfully from the event arguments or from the scheduler.get_resources() based on the resource key? Optionally, how can i find the index of a resource from the resource collection by the resource key so I can use the getResource(index) function?
I'm using version 2011.1.413.40.
Thanks