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

Webservice Validation before editing appointment

4 Answers 80 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Fabio Honigmann
Top achievements
Rank 2
Fabio Honigmann asked on 17 Jul 2008, 08:05 PM
Hi,

I have been trying to call a webservice validation to the events before the editor allows someone to edit an appointment.

But i can't find a way to actually stop the scheduler from opening the form.

I call the validation OnClientAppointmentDoubleClick

var hasReservations = null
function OnClientAppointmentDoubleClick(sender, eventArgs) 
    var strId = eventArgs.get_appointment().get_id().substring(0, 36); 
    WebServices.SiteService.EventHasRegistration(strId, OnLookupComplete, OnError); 


then i set the hasReservations = true/false depending if there are any reservations to that appointment.

I try using the following code to stop the schduler, but it wont work due to the async. delay.
if(hasReservations == null || hasReservations== 'undefined'
    eventArgs.set_cancel(true); 
    radalert("Validation service currently unavailable. Editing events are not available at this time."); 
    return
 
if(hasReservations) 
    radalert("Some occurrences of this series have reservations assigned to them, they will not be modified."); 
    eventArgs.set_cancel(true); 
 

How am i able to implement such thing?

This doesn't have to happen on the client side, but i cant't find a way to validate it before the client recurrence popup is displayed.

The client documentation for the scheduler is horrible, and i cant find anything i need.

Someone please help me!

Thanks

Fabio


4 Answers, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 18 Jul 2008, 08:55 AM
Hi Fabio Honigmann,

The OnClientAppointmentDoubleClick event cannot be canceled - use OnClientAppointmentEditing instead as it can be canceled and will most probably fit to your case.

The documentation for RadScheduler has been updated recently - old content has been revised and new has been added - so try it out here.

Regards,
Simon
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Fabio Honigmann
Top achievements
Rank 2
answered on 18 Jul 2008, 01:31 PM
Thank you simon. I was able to get it working as expected.

The problem i find with the client documentation is that i can only find information about the events, but i can't find the definition of the objects used or returned by them.

For example for OnClientAppointmentEditing the event handler gives me sender and eventArgs then i can do get_appointment() great!

But I have not been able to find what are the properties available for that appointment object returned and the same applies to all other client objects.

I look forward to see client documentation for all members and related classes of the scheduler.

Thank you.
0
Simon
Telerik team
answered on 18 Jul 2008, 04:39 PM
Hello Fabio Honigmann,

We have recently added the APIs of the RadScheduler's client-side objects to the documentation and it is available in the Help for RadControls for ASP.NET AJAX Q2 Futures.

For example, the SchedulerAppointment Object's properties and methods are outlined here - SchedulerAppointment Object.

With the official release of Q2 all of the new content will be available in the Help here.

Regards,
Simon
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Fabio Honigmann
Top achievements
Rank 2
answered on 18 Jul 2008, 06:19 PM
That is GREAT.

Thank you!
Tags
Scheduler
Asked by
Fabio Honigmann
Top achievements
Rank 2
Answers by
Simon
Telerik team
Fabio Honigmann
Top achievements
Rank 2
Share this question
or