Get resource_ID on client side

4 posts, 0 answers
  1. Andy Green
    Andy Green avatar
    342 posts
    Member since:
    Aug 2008

    Posted 12 Jan 2015 Link to this post

    I'm just starting to use grouping as it solves a big problem we have, and so far the display for rendering the data is great.

    The way we add appointments is to open our own in house booking form, via javascript.

    Now with the scheduler showing several locations, when we click in a column (for horizontal grouping) or a row for vertical grouping) how do I get a handle on the resource ID?

    Andy
  2. Andy Green
    Andy Green avatar
    342 posts
    Member since:
    Aug 2008

    Posted 12 Jan 2015 in reply to Andy Green Link to this post

    Some further info on this issue, I have the following JS function

    function pageLoad() {
    var $ = $telerik.$,
    scheduler = $find("<%=rsRoomBooking.ClientID%>");
    $(".rsContentTable td").mouseup(function myfunction() {
    var startTime = getISODateTime(scheduler.get_selectedSlots()[0].get_startTime());
    var selectionLength = scheduler.get_selectedSlots().length;
    var endTime = getISODateTime(scheduler.get_selectedSlots()[selectionLength - 1].get_endTime());
    ShowAddBooking(0, startTime, endTime, locationID, locationName);
    });
    }

    Currently LocationID and Location name are hidden variables populated from code behind. These now have to be the Resource_ID's from the corresponding area on the Scheduler.

    Andy
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Andy Green
    Andy Green avatar
    342 posts
    Member since:
    Aug 2008

    Posted 13 Jan 2015 in reply to Andy Green Link to this post

    I think I have sorted this.

    var Location_ID = scheduler.get_selectedSlots()[0].get_resource().get_key()
    var locationName = scheduler.get_selectedSlots()[0].get_resource().get_text()

    Is this the correct approach, as it seems to work OK?

    Andy
  5. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    1746 posts

    Posted 15 Jan 2015 Link to this post

    Hеello Andy,

    Indeed retrieving the resource key and text value using the time slot object is the suggest approach.


    Regards,
    Boyan Dimitrov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top