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

Select appointments client-side

1 Answer 101 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Adam
Top achievements
Rank 1
Adam asked on 05 Sep 2008, 08:53 PM
Is there a way to select an appointment on the scheduler on the client side? I can double click and single click, but I need that selection to be maintained so I can then click and Edit button in a toolbar to then take them to a different screen to edit the selected instance. I also need the selected date to look different (highlighted such as in the RadGrid).

1 Answer, 1 is accepted

Sort by
0
Accepted
Peter
Telerik team
answered on 08 Sep 2008, 02:54 PM
Hi Adam,

Thank you for your question. We willo prepare a KB article to address this scenario, but in the meanwhile you can use the following solution:

<head runat="server">  
    <title>Untitled Page</title> 
     <style type="text/css">     
   .rsApt.HighlightStyle .rsAptInner     
   {     
       background: yellow;     
   }  
    </style> 
</head> 
<body> 
    <form id="form1" runat="server">  
    <asp:ScriptManager ID="ScriptManager1" runat="server">  
    </asp:ScriptManager> 
    <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> 
 
    <input id="Button1" type="button" onclick="alertCurrentlySelectedApp()" value="alert currently selected app" /> 
    <telerik:RadScheduler   
        EnableViewState="false" 
        OnClientAppointmentClick="OnClientAppointmentClick" 
        ID="RadScheduler1"   
        runat="server" 

Let us know how it goes.

Regards,
Peter
the Telerik team

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