Validation and default selection of RadSchedulerRecurrenceEditor

2 posts, 0 answers
  1. Tejas
    Tejas avatar
    1 posts
    Member since:
    Oct 2011

    Posted 09 Oct 2011 Link to this post

    Hi 
    I have two questions regarding the 'RadSchedulerRecurrenceEditor' control.

    1) I want to hide the 'No end date' and have 'End by' selected as default.
    for this I used the following script

    function pageLoad() {
    var $ = 
    $telerik.$;
    $(".RecurrenceEditor").children().each(function (i) {   
            //by default set the 'End by' radio selected
               
    var chkEndAfter = 
                document.getElementById('MainContent_UCReccuranceControl1_ffRecurrenceEditor_RepeatUntilGivenDate');  
              chkEndAfter.checked = true;

              //hide the 'No end date' radio option
                  $telerik.$(".rsAdvOptionsPanel ul li:first-child").hide();       
                 });

    so as a default set the 'End by' radio selected, is there a better way to get to the  'End by' control and have it selected.

    2) Secondly the other scenario is if I select the 'End after' radio option I would like to use a client side custom validator to check if the 'end after' text box is not empty or null  

    Please let me know ASAP and its kind of urgent.
    Thanks in advance.

    Tejas
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 11 Sep 2012 Link to this post

    Hi Tejas,

    1) Try the following code snippet to to hide the 'No end date' and have 'End by' selected as default.

    JS:
    <script type="text/javascript">
        $(document).ready(function (event) {
            $(".rsAdvOptionsPanel ul li:first-child").hide();
            $("#RadSchedulerRecurrenceEditor1_RepeatUntilGivenDate").attr('checked', true);
        });
    </script>

    2) Try the following code snippet to achieve your second scenario.

    JS:
    <script type="text/javascript">
        $(document).ready(function (event) {
            $("#RadSchedulerRecurrenceEditor1_RepeatGivenOccurrences").click(function () {
                if ($('#RadSchedulerRecurrenceEditor1_RepeatGivenOccurrences').is(':checked')) {
                    var RadSchedulerRecurrenceEditor1 = $find('<%=RadSchedulerRecurrenceEditor1.ClientID %>');
                    if (RadSchedulerRecurrenceEditor1._getControl("RangeOccurrences").get_value()=="") {
                        alert("text is empty");
                    }
                }
            });
        });
    </script>

    Hope this helps.

    Regards,
    Princy.
Back to Top