I have an issue with a custom Advanced Form and the Recurrence Editor Control. I had the recurrence editor defaulting to being checked as 'End By Day'. This is all working no problem when I choose New Appointment from the Context Menu or double click for a new appointment. However, when we choose 'New Recurring Appointment' from the context menu it always chooses 'No End Date' as the selection criteria. My question is how can I get the 'End By Date' to be selected when we open a 'New Recurring Appointment' from the context menu?
We have the following in the Page Pre Render when it is not initialized:
Dim
endDateRadio
As
RadioButton =
DirectCast
(AppointmentRecurrenceEditor.FindControl(
"RepeatUntilGivenDate"
), RadioButton)
endDateRadio.Checked =
True
4 Answers, 1 is accepted
You can check the 'End By Day' checkbox in the onClientFormCreated event as in the code below:
function
schedulerFormCreated(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
checkbox = $(
"[id$='RepeatUntilGivenDate']"
);
checkbox.attr(
"checked"
,
"checked"
);
// Initialize the client-side object for the advanced form
var
formElement = eventArgs.get_formElement();
Hope this will be helpful.
Greetings,
Plamen
the Telerik team
if (mode == Telerik.Web.UI.SchedulerFormMode.AdvancedInsert)
{
var $ = $telerik.$;
var checkbox = $("[id$='RepeatUntilGivenDate']");
checkbox.attr("checked", "checked");
Thanks for the help.
Chris
I tried with the above code, it didn't resolve the default check "END BY", can you please see the code below:
<script type="text/javascript">
function OnClientFormCreated(sender, eventArgs) {
$telerik.$(".rsAdvRecurrenceRangePanel .rsAdvOptionsPanel ul li:first-child").hide();
$telerik.$(".rsAdvRecurrenceRangePanel .rsAdvOptionsPanel ul li:nth-child(2)").hide();
$telerik.$('.rsAdvWeekly_WeekDays li:first-child').hide();
$telerik.$('.rsAdvWeekly_WeekDays li:last-child').hide();
}
function pageLoad() {
var $ = $telerik.$;
$(".rsRecurrenceOptionList").children().each(function (i) {
if (i < 2)
$(this).hide();
});
var $ = $telerik.$;
$(".rsRecurrenceOptionList").children().each(function (i) {
if (i ==4)
$(this).hide();
});
}
function OnClientFormCreated(sender, args) {
// 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 checkbox = $("[id$='RepeatUntilGivenDate']");
checkbox.attr("checked", "checked");
// Initialize the client-side object for the advanced form
var formElement = eventArgs.get_formElement();
}
}
</script>
<script type="text/javascript">
function OnClientFormCreated(sender, args) {
$telerik.$(".rsAdvRecurrenceRangePanel .rsAdvOptionsPanel ul li:first-child").hide();
$telerik.$(".rsAdvRecurrenceRangePanel .rsAdvOptionsPanel ul li:nth-child(2)").hide();
$telerik.$('.rsAdvWeekly_WeekDays li:first-child').hide();
$telerik.$('.rsAdvWeekly_WeekDays li:last-child').hide();
var $ = $telerik.$;
var mode = args.get_mode();
if (mode == Telerik.Web.UI.SchedulerFormMode.AdvancedInsert || mode == Telerik.Web.UI.SchedulerFormMode.AdvancedEdit) {
var recurrenceEditorJqueryObj = $("[id$='RangeEndDate']");
var recurrenceEditor = $find(recurrenceEditorJqueryObj.attr("id"));
var today = new Date();
today.setMonth(today.getMonth() + 6);
recurrenceEditor.set_selectedDate(today);
}
}
 
</script>
Here is the code that worked at my side:
function
OnClientFormCreated(sender, args) {
var
$ = $telerik.$;
$(
".rsAdvRecurrenceRangePanel .rsAdvOptionsPanel ul li:first-child"
).hide();
$(
".rsAdvRecurrenceRangePanel .rsAdvOptionsPanel ul li:nth-child(2)"
).hide();
$(
'.rsAdvWeekly_WeekDays li:first-child'
).hide();
$(
'.rsAdvWeekly_WeekDays li:last-child'
).hide();
// Create a client-side object only for the advanced templates
var
mode = args.get_mode();
if
(mode == Telerik.Web.UI.SchedulerFormMode.AdvancedInsert ||
mode == Telerik.Web.UI.SchedulerFormMode.AdvancedEdit) {
var
$ = $telerik.$;
var
checkbox = $(
"[id$='RepeatUntilGivenDate']"
);
checkbox.attr(
"checked"
,
"checked"
);
// Initialize the client-side object for the advanced form
}
}
I am also attaching my test page.
Regards,
Plamen
Telerik