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

How do I set start and end times client side?

1 Answer 78 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 1
Steve asked on 31 Dec 2013, 10:46 PM
If I have the timeslots set to 7:00am - 10:00pm, I need to set the start time and end times in the advanced insert and advanced edit forms to be the same. Currently, they are 8:00am - 5:30pm. I need to do this client side. All the examples I see do this server side.

1 Answer, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 03 Jan 2014, 11:22 AM
Hello,

I would suggest using the RadScheduler client-side event ClientFormCreated as shown in the code snippet below:
//markup code
<telerik:RadScheduler ID="RadScheduler1" runat="server" OnClientFormCreated="clientFormCreated" ></telerik:RadScheduler>

//JavaScript
<script type="text/javascript">
    //Put your JavaScript code here.
    function clientFormCreated(sender, args) {
        var mode = args.get_mode();
        if (mode == Telerik.Web.UI.SchedulerFormMode.AdvancedInsert ||
            mode == Telerik.Web.UI.SchedulerFormMode.AdvancedEdit) {
            var startTimejQueryObject = $("[id$='Form_StartTime']");
            var startTimePicker = $find(startTimejQueryObject.attr("id"));
            //sets the start time to 1 PM
            startTimePicker.get_dateInput().set_value("07:00 AM");
 
            var endTimejQueryObject = $("[id$='Form_EndTime']");
            var endTimePicker = $find(endTimejQueryObject.attr("id"));
            //sets the end time to 4 PM
            endTimePicker.get_dateInput().set_value("10:00 AM");
        }
    }
</script>

Please refer to the following help articles for more information:

Regards,
Boyan Dimitrov
Telerik
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 the blog feed now.
Tags
Scheduler
Asked by
Steve
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Share this question
or