Recurrence Editor Issue

5 posts, 0 answers
  1. Chris
    Chris avatar
    5 posts
    Member since:
    Jul 2012

    Posted 30 Jul 2012 Link to this post

    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

     

  2. Plamen
    Admin
    Plamen avatar
    2729 posts

    Posted 01 Aug 2012 Link to this post

    Hello Chris,

     
    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 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. UI for ASP.NET Ajax is Ready for VS 2017
  4. Chris
    Chris avatar
    5 posts
    Member since:
    Jul 2012

    Posted 01 Aug 2012 Link to this post

    Thanks, this worked.  One note, I slightly changed the code so it only makes the change if we are adding a new appointment series so it does not choose the number of occurrences if you dont change the code to the following...
    if (mode == Telerik.Web.UI.SchedulerFormMode.AdvancedInsert)
    {
                 var $ = $telerik.$;
                 var checkbox = $("[id$='RepeatUntilGivenDate']");
                 checkbox.attr("checked", "checked");

    Thanks for the help.

    Chris
  5. Sarah Shum
    Sarah Shum avatar
    3 posts
    Member since:
    Nov 2007

    Posted 16 Jun 2015 Link to this post

    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>

  6. Plamen
    Admin
    Plamen avatar
    2729 posts

    Posted 19 Jun 2015 Link to this post

    Hello,

    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
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017