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

Recurrence editor - check saturday

1 Answer 70 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Asesoftware ltda
Top achievements
Rank 1
Asesoftware ltda asked on 02 Mar 2012, 04:27 PM
Hi,

I'm using then telerik recurrence editor control for create a recurrence for a request of services. When you create a recurrence (weekly) selecting any days, then saturday is ckecked in postback (when the user presses any button).

In then next link you can see a demo.
http://youtu.be/s9wTIBXmv_Q


Can you help me please.

Thanks, cmarquez

1 Answer, 1 is accepted

Sort by
0
Ivana
Telerik team
answered on 07 Mar 2012, 02:12 PM
Hello Cmarquez,

Thank you for contacting the Telerik team.

The advanced form of RadScheduler is not supposed to postback except on closing (when Save or  Cancel button is clicked).
You could use the following approach to uncheck the current day in the WeeklyPanel, but you should keep in mind that when a postback occurs there might be other discrepancies with the RecurrenceEditor:
var Days = { "Sunday": 0, "Monday": 1, "Tuesday": 2, "Wednesday": 3, "Thursday": 4, "Friday": 5, "Saturday": 6 };
 
function OnClientFormCreated(scheduler, eventArgs) {
    // Create a client-side object only for the advanced templates
    var mode = eventArgs.get_mode();
    if (mode == Telerik.Web.UI.SchedulerFormMode.AdvancedInsert ||
            mode == Telerik.Web.UI.SchedulerFormMode.AdvancedEdit) {
        var $ = $telerik.$;
        var weekListItems = $(".rsAdvWeekly ul li");
        var selectedDayNumber = scheduler.get_selectedDate().getDay();
        var selectedDay = "";
        $.each(Days, function (item, index) {
            if (index == selectedDayNumber) {
                selectedDay = item;
            }
        });
 
        $.each(weekListItems, function (index, item) {
            if (item.firstChild.firstChild.checked && item.firstChild.childNodes[1].innerHTML == selectedDay) {
                item.firstChild.firstChild.checked = false;
            }
        });
    }
For more information on how to access the elements/ controls inside the advanced form you could refer to the following help article:  http://www.telerik.com/help/aspnet-ajax/scheduler-customizing-advanced-form-javascript-jquery-css.html.

I hope this will help.

Please feel free to contact us if you have further questions.

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