I need to get class name for timeslot. I set some of the slots unavailable and I need to check if user clicked on unavailable slot.
Thanks,
Roman
2 Answers, 1 is accepted
0
Simon
Telerik team
answered on 23 Jul 2008, 12:19 PM
Hi Roman,
You can manually find the td element representing the clicked Time Slot and check its class name. You can use the timeSlot.get_rawIndex().dayIndex to get the day index of the time slot in the currently displayed View.
The code below shows how this can be done in case the CSS class for the unavailable Time Slots is called "unavailable":
function clientTimeSlotClick(sender, eventArgs)
{
if (sender.get_selectedView() == 2)
{
var schedulerDiv = $get(sender.get_id());
var contentTable = schedulerDiv.childNodes[4].childNodes[1];
var dayIndex = eventArgs.get_targetSlot().get_rawIndex().dayIndex;
var tds = contentTable.getElementsByClassName("rsCell");
Note that this approach will work only in Month View. Since the rendering of the Views are different from one another you need to examine each one and implement the logic for finding the Time Slot manually. For example, in Week View, the Time Slot client-side object's rawIndex contains the cellIndex and the rowIndex of the cell representing the Time Slot. You need to find the cell by these two indexes.