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

Recurrence editor - check Daily option by default

4 Answers 57 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Ben
Top achievements
Rank 1
Ben asked on 25 Feb 2012, 10:25 PM
Hi

I'm using the following code to hide all options apart from Daily and Weekly, which is works fine.
$(".rsRecurrenceOptionList").children().each(function (i) {
if (i < 1 || i > 2)
$(this).hide();
});

I now want to have the Daily option checked by default, so added the line of code below, but can't seem to get it working.
$(".rsRecurrenceOptionList li:eq(1) span input").attr("checked", "checked");

Can you please help.

Thanks, Ben

4 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 29 Feb 2012, 04:27 PM
Hi Ben,

 
If you want to check only Daily Checkbox with jQuery you can use the following code that worked at my side:

$(".rsRecurrenceOptionList").children().each(function (i) {
                       if (i < 1 || i > 2)
                           $(this).hide();
                   });
                   $(".rsRecurrenceOptionList li:eq(1) input").attr("checked", "checked");

I can also refer to the the Handling FormCreated event where in the Make changes in the recurrence editor section is shown how to check it on the server side.

Hope this will help.

Regards,
Plamen Zdravkov
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.
0
Ben
Top achievements
Rank 1
answered on 03 Mar 2012, 11:29 AM
Hi

I've added the line...

$(".rsRecurrenceOptionList li:eq(1) input").attr("checked", "checked");

and  the daily option box is now checked, but the daily options are not visible until it is clicked again.

Print screen attached, is what is displayed on first load.

Thanks, Ben

0
Accepted
Plamen
Telerik team
answered on 05 Mar 2012, 04:23 PM
Hi Ben,

 
You can trigger the click event as in the code bellow:

$telerik.$(".rsRecurrenceOptionList li:eq(1) input").click();

Hope this will help you.

All the best,
Plamen Zdravkov
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.
0
Ben
Top achievements
Rank 1
answered on 05 Mar 2012, 11:44 PM
Thanks Plamen.
Tags
Scheduler
Asked by
Ben
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Ben
Top achievements
Rank 1
Share this question
or