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

Validation and default selection of RadSchedulerRecurrenceEditor

1 Answer 152 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Tejas
Top achievements
Rank 1
Tejas asked on 10 Oct 2011, 04:58 AM
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

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 11 Sep 2012, 09:15 AM
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.
Tags
Scheduler
Asked by
Tejas
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or