Recurrence editor - check Daily option by default

5 posts, 1 answers
  1. Ben
    Ben avatar
    10 posts
    Member since:
    Dec 2011

    Posted 25 Feb 2012 Link to this post

    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
  2. Plamen
    Admin
    Plamen avatar
    3079 posts

    Posted 29 Feb 2012 Link to this post

    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.
  3. Ben
    Ben avatar
    10 posts
    Member since:
    Dec 2011

    Posted 03 Mar 2012 Link to this post

    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

  4. Answer
    Plamen
    Admin
    Plamen avatar
    3079 posts

    Posted 05 Mar 2012 Link to this post

    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.
  5. Ben
    Ben avatar
    10 posts
    Member since:
    Dec 2011

    Posted 05 Mar 2012 Link to this post

    Thanks Plamen.
Back to Top