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

Occupied Timeslots by Resource

5 Answers 59 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Nick
Top achievements
Rank 1
Nick asked on 07 Jun 2009, 10:24 PM
Using the Occupied Timeslots example, I would like to be able to take into account the diiferent resources that I have. For example, although Room A may be occupied, I would still be able to schedule Room B for the same time slot. How could I go about doing this?

5 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 08 Jun 2009, 04:05 PM
Hello Nick,

You should follow the Resource Availability demo instead which shows a client side implementation of the desired functionality:
http://demos.telerik.com/aspnet-ajax/scheduler/examples/resourceavailability/defaultcs.aspx


Kind regards,
Peter
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Nick
Top achievements
Rank 1
answered on 09 Jun 2009, 06:50 PM
I have looked at the resource availablity example and it looks like it has some pieces I can use. However, when I use the client side functions I get the following error when I try to drag an appointment.

"Object Doesn't Support this Property or Method" and it breaks at the following line within the isRoomOccupied function.

 

 

currentRoom = slot.get_resource();

I've tried creating a new project and just added the code from the example's aspx page and still get the same error.

 

 

 

 

 

 

0
Peter
Telerik team
answered on 10 Jun 2009, 01:34 PM
Hi Nick,

Please, open a suppor ticket and send us a simple working project for testing.

Best wishes,
Peter
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
David Brenchley
Top achievements
Rank 1
answered on 19 Jul 2011, 03:01 AM
I also was getting the same error.  Created ticket: 444751
0
Peter
Telerik team
answered on 19 Jul 2011, 12:19 PM
Hi David ,

The demo that you have used for reference relies on that RadScheduler is grouped by a resource type. If it is not, then slot.get_resource will be undefined. You can improve the code to automatically resolve the case when RadScheduler is not grouped by a resource type with a simple condition like this:

function isRoomOccupied(scheduler, start, end, slot, appointment)
           {
               //get the "Room" resource associated with the time slot
               var currentRoom;
               if(slot.get_resource)
               {
                     currentRoom = slot.get_resource();                   
               }
               //get all appointments for this "room" in the specified period
               var appointmentsForThisRoom = getAppointmentsInRangeByResource(scheduler, start, end, currentRoom, appointment);
               //if the list of appointments is not empty there are other appointments in this slot
               return appointmentsForThisRoom.get_count() > 0;
           }

Feel free to contact us again if you still experience any issues.

Best wishes,
Peter
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
Scheduler
Asked by
Nick
Top achievements
Rank 1
Answers by
Peter
Telerik team
Nick
Top achievements
Rank 1
David Brenchley
Top achievements
Rank 1
Share this question
or