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

Get Recource Timeslot key

1 Answer 27 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Sander
Top achievements
Rank 1
Sander asked on 02 Sep 2011, 03:32 PM
Hi there,

At the moment I am working with recourses. I have 2 agenda's in my scheduler now. But I have a problem. I am working with schemes. And one person has another scheme than another person. When a person clicks on a timeslot I have to check if the person create an appointment and not outside of that scheme. How can I get the timeslot resource key when clicking on a timeslot? I need it in C#.

I hope someone can help me.

Thanks in advance.

Sander

1 Answer, 1 is accepted

Sort by
0
Ivana
Telerik team
answered on 06 Sep 2011, 03:57 PM
Hi Sander,

You can subscribe to the client event OnClientTimeSlotClick and get the TimeSlot's resource in there. Then you can use RadAjaxManager  to make an Ajax Request to the server having the resource key as an argument of the ajaxRequest method.

JS and RadAjaxManager:
<telerik:RadCodeBlock runat="server">
        <script type="text/javascript">
            function radScheduler1_clientTimeSlotClick(sender, eventArgs) {
                var timeSlot = eventArgs.get_targetSlot();
                //If the current View is grouped by Resource,
                //returns the Resource object. Otherwise, returns null.
                var resource = timeSlot.get_resource();
                if (timeSlot.get_resource) {
                    $find("<%=RadAjaxManager1.ClientID %>").ajaxRequest(resource.get_key());
                }
            }
        </script>
    </telerik:RadCodeBlock>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadScheduler1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

More info about the SchedulerTimeSlot's methods and properties you can find in the following article:
SchedulerTimeSlot and SchedulerModel.

Regards,
Ivana
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
Scheduler
Asked by
Sander
Top achievements
Rank 1
Answers by
Ivana
Telerik team
Share this question
or