I am having problem. I have radSchedular that is populating from database. I wrote TimeSlotCreated server side event in which I set the disabled/enabled class based on my required condition (e.TimeSlot.CssClass = "Disabled";)
In my ASPX page i wrote
function OnClientTimeSlotClick(sender, eventArgs)
{
var now = new Date();
if (sender.get_selectedView() == Telerik.Web.UI.SchedulerViewType.WeekView) {
if (eventArgs.get_time() < now) {
alert("Time slot not available");
}
}
}
this event simply shows alert if the tiemslot time is less than current time.
I need to get the CssClass and check if CssClass is "disabled" or "enabled". So that I can show alert('Time slot not available') if the CssClass is 'disabled'.
Prompt response is highly appreciated.
Regards,
Mohsin
8 Answers, 1 is accepted
Here is one possible solution:
<script type=
"text/javascript"
>
function
OnClientTimeSlotClick(sender, args) {
var
timeSlotClassName = args.get_targetSlot().get_domElement().className;
alert(timeSlotClassName.match(
"Disabled"
));
//match() will return null if no such string is found
}
</script>
Greetings,
Peter
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Thanks for the help, it really works for me.
But when I place this code under OnClientAppointmentMoveEnd event this will not giving me desired result.
It is showing the Class of moved appointment. I want the classname of the target slot where the appointment has been moved.
Further more i want the same scenario on OnClientAppointmentResizeEnd event.
please tell me how to do this.
Regards,
Mohsin
When handling OnClientAppointmentResizeEnd and OnClientAppointmentMoveEnd you can use the get_targetSlot() method.
Kind regards,
Peter
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

I have placed following code in OnClientAppointmentResizeEnd and OnClientAppointmentMoveEnd event
var slotElement = $telerik.$(eventArgs.get_targetSlot().get_domElement());
if (slotElement.is(".Disabled") || slotElement.parent().is(".Disabled")) {
eventArgs.set_cancel(true);
}
OnClientAppointmentResizeEnd work fine with above code but OnClientAppointmentMoveEnd does not. It is not getting targetSlot css, it is getting the currently selected appointment's class.
Please suggest what do I do, is there other way to do that???
Regards,
Mohsin
This might be a bug with RadScheduler. We will examine it closer and follow up if we succeed in finding a workaround.
All the best,
Peter
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

This must be a bug, I also get the CssClass of the Appointment instead of the Timeslot in the OnClientAppointmentMoveEnd clientevent.
I am glad to let you know that this bug has been recently fixed. Please, try with the latest internal build and let me know if all is fine.
All the best,
Peter
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

I can confirm it's now working, great job!!
Thanks,
Frank