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

Get resource_ID on client side

3 Answers 59 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Andy Green
Top achievements
Rank 2
Andy Green asked on 12 Jan 2015, 04:42 PM
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

3 Answers, 1 is accepted

Sort by
0
Andy Green
Top achievements
Rank 2
answered on 12 Jan 2015, 04:52 PM
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
0
Andy Green
Top achievements
Rank 2
answered on 13 Jan 2015, 08:09 AM
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
0
Boyan Dimitrov
Telerik team
answered on 15 Jan 2015, 09:35 AM
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.

 
Tags
Scheduler
Asked by
Andy Green
Top achievements
Rank 2
Answers by
Andy Green
Top achievements
Rank 2
Boyan Dimitrov
Telerik team
Share this question
or