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

Selected state of the appointment

3 Answers 55 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Ian Russell
Top achievements
Rank 1
Ian Russell asked on 22 Nov 2008, 12:17 AM
Is there a way to implement a Selected State of the appointment? Like on a single click I would like to change appointment's style. I saw a post about doing it client-side but I want to implement it server-side.

3 Answers, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 24 Nov 2008, 04:49 PM
Hello Attila Safari,

Thank you for contacting Telerik support.

You could use the AppointmentClick server-side event to change the appearance of the clicked Appointment. However, please have in mind that this event as the Appointment is double-clicked on the client.

In case you want to handle the case on the first click, you could handle the client-side OnClientAppointmentClick event and change the behavior there.

Alternatively, you could use RadAjaxManager to do an AJAX request to the server manually on the first click, perform server-side operations and change the appearance of the clicked Appointment (by using its ID).

Please let me know if you have any additional questions or you need further assistance.

Kind regards,
Simon
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Oleg
Top achievements
Rank 1
answered on 08 Jan 2009, 04:26 PM
Do you have an example by any chance of how to do it using OnClientAppointmentClick?
0
Peter
Telerik team
answered on 09 Jan 2009, 03:57 PM
Hi Oleg,

Here is a client-side solution:

 <script type="text/javascript">  
         var currentlySelectedAppoitment;  
         var previouslySelectedAppoitment;  
         function OnClientAppointmentClick(sender, eventArgs) {  
             if (previouslySelectedAppoitment != null) {  
                 var prevRsAptElement = previouslySelectedAppoitment.get_element();  
                 Sys.UI.DomElement.toggleCssClass(prevRsAptElement, "HighlightStyle");  
 
             }  
             currentlySelectedAppoitment = eventArgs.get_appointment();  
             var rsAptElement = currentlySelectedAppoitment.get_element();  
             Sys.UI.DomElement.toggleCssClass(rsAptElement, "HighlightStyle");  
             previouslySelectedAppoitment = currentlySelectedAppoitment;  
 
         }  
         function alertCurrentlySelectedApp() {  
             if (currentlySelectedAppoitment)  
                 alert(currentlySelectedAppoitment.get_subject());  
         }     
    </script>   

.HighlightStyle .rsAptOut   
   {        
       backgroundyellow !important;        
   }    



All the best,
Peter
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Scheduler
Asked by
Ian Russell
Top achievements
Rank 1
Answers by
Simon
Telerik team
Oleg
Top achievements
Rank 1
Peter
Telerik team
Share this question
or