Occupied Timeslots by Resource

6 posts, 0 answers
  1. Nick
    Nick avatar
    11 posts
    Member since:
    Jan 2009

    Posted 07 Jun 2009 Link to this post

    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?

  2. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 08 Jun 2009 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Nick
    Nick avatar
    11 posts
    Member since:
    Jan 2009

    Posted 09 Jun 2009 Link to this post

    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.

     

     

     

     

     

     

  5. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 10 Jun 2009 Link to this post

    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.
  6. David Brenchley
    David  Brenchley avatar
    67 posts
    Member since:
    Jun 2010

    Posted 18 Jul 2011 Link to this post

    I also was getting the same error.  Created ticket: 444751
  7. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 19 Jul 2011 Link to this post

    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!

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017