Recurrance "END BY" not checked

2 posts, 0 answers
  1. Sarah Shum
    Sarah Shum avatar
    3 posts
    Member since:
    Nov 2007

    Posted 16 Jun 2015 Link to this post

    I tried to default "END BY" as my default recurrance appointment, can you please check below code?

    <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 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", true);
    // 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);

    $(document).ready(function (event) {
    $("#RadSchedulerRecurrenceEditor1_RepeatUntilGivenDate").attr('checked', true);
    });
     

    }
    }
     
    </script>
    <script type="text/javascript">
    $(document).ready(function (event) {
    $("#RadSchedulerRecurrenceEditor1_RepeatUntilGivenDate").click(function () {
    if ($('#RadSchedulerRecurrenceEditor1_RepeatUntilGivenDate').is(':checked')) {

    if (RadSchedulerRecurrenceEditor1._getControl("RepeatUntilGivenDate").get_value() == "") {
    alert("text is empty");
    }
    }
    });
    });
    </script>

  2. Plamen
    Admin
    Plamen avatar
    2729 posts

    Posted 19 Jun 2015 Link to this post

    Hi,

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top