This is a migrated thread and some comments may be shown as answers.

'OnClientAppointmentInserting' - how to obtain value of resource

3 Answers 82 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Anthony
Top achievements
Rank 1
Anthony asked on 02 Dec 2010, 05:54 PM
Hello,

I am grouping my appointments by a resource: 'Rooms'.

There are three Rooms and when I insert an appointment in say, 'Mr. Smith's Room', I want to be able to obtain the value: 'Mr. Smith's Room' in my 'OnClientAppointmentInserting' function.

How can I achieve this?

Regards,
Anthony

3 Answers, 1 is accepted

Sort by
0
Veronica
Telerik team
answered on 06 Dec 2010, 05:43 PM
Hello Anthony,

You can not get the resource name in OnAppointmentInsering event as you can not get the appointment object directly through the event arguments of the event. Instead you can subscribe to the OnClientFormCreated event and use the following code in the handler:

function OnClientFormCreated(sender, args) {
           var app = args.get_appointment();
           var resources = app.get_resources().getResourcesByType("Room");
           for (var i = 0; i < resources.get_count(); i++) {
               alert(resources.getResource(i).get_text());
           }
       }

Hope this helps.

Best wishes,
Veronica Milcheva
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Accepted
Veronica
Telerik team
answered on 13 Dec 2010, 01:32 PM
Hello Anthony,

Here's the code for retrieving the resources in OnClientAppointmentInserting event for those who follow-up the forum post:

function OnClientAppointmentInserting(sender, args) {
                alert(args.get_targetSlot().get_resource().get_text());
            }

In my case I am getting the resource text. You can get any property of the SchedulerResource client-side object.

Best wishes,
Veronica Milcheva
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Anthony
Top achievements
Rank 1
answered on 13 Dec 2010, 02:41 PM
This is exactly what I was looking for.

Thank you
Tags
Scheduler
Asked by
Anthony
Top achievements
Rank 1
Answers by
Veronica
Telerik team
Anthony
Top achievements
Rank 1
Share this question
or