Get resource ID OnClientAppointmentInserting

2 posts, 0 answers
  1. Gilbert
    Gilbert avatar
    5 posts
    Member since:
    Jul 2012

    Posted 23 Nov 2012 Link to this post

    Hi,

    I'm looking for a way to get the resource id that i've grouped my scheduler by in javascript. Is this possible?
    Using OnClientAppointmentInserting i can get the start time and is all day properties. Is there any way to get the room id that i have grouped by?

    function AppointmentInserting(sender, eventArgs) {
                        var start = formatDate(eventArgs.get_startTime());
                        var isAllDay = eventArgs.get_isAllDay();
                        alert(start);
                        alert(isAllDay);
                        eventArgs.set_cancel(true);
                    }
  2. Plamen
    Admin
    Plamen avatar
    2958 posts

    Posted 26 Nov 2012 Link to this post

    Hello Gilbert,

    Thank you for contacting Telerik support.

    You can get the name of the resource that is grouping RadScheduler by using the get_groupBy() method of its client object and you can get the resource of the time slot by using the get_resource() method of the timeslot's client object:

    Copy Code
    function OnClientAppointmentInserting(sender, args) {
                   alert(sender.get_groupBy());
                   alert(args.get_targetSlot().get_resource());
     
               }

    Hope this will be helpful. 

    All the best,
    Plamen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top