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

RecurrenceEditor Automatically Reselects Saturday on PostBack

3 Answers 25 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Kerry
Top achievements
Rank 1
Kerry asked on 25 Jul 2013, 09:12 PM
I have set the recurrence at runtime to weekly, every one week, on Friday. Another control in my custom edit form causes a postback. Upon return from that postback, Saturday will also be selected. I tried many other combinations of weekly recurrence, all with the same result. If I choose a different recurrence frequency, everything works just fine.

Thanks,
Kerry

3 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 30 Jul 2013, 02:04 PM
Hi,

 

Here is one possible workaround if the issue that uses a hidden field in order to persist the state of the Saturday check box after PostBack:

    function pageLoad() {
        var $ = $telerik.$;
        var hiddenField = document.getElementById("HiddenField1");
            if (hiddenField.value == "false") {
                document.getElementById("RadSchedulerRecurrenceEditor1_WeeklyWeekDaySaturday").checked = false;
            }
        $(".rsAdvWeekly ul li").click(function myfunction(e) {
            if ((this.textContent) == "Saturday") {
                if (e.target.checked) {
                    hiddenField.value = "true";
                }
                else {
                    hiddenField.value = "false";
                }
            }
        });
 
    }
</script>
<div>
    <asp:HiddenField runat="server" ID="HiddenField1" />


Hope this will be helpful.

Regards,
Plamen
Telerik
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 the blog feed now.
0
Kerry
Top achievements
Rank 1
answered on 19 Aug 2013, 02:29 PM
Sorry it took so long to get back, our office moved and we've had some issues.

I'm having a slight issue in locating the Recurrence Editors Saturday checkbox at run time.

All our pages are user controls dropped onto DotNetNuke pages. Consequently, the controls all have the DNN 'Client' naming scheme. It was easy enough to handle locating the hidden field with:

$find("<%= HiddenField1.ClientID %>")


However, working with the following line is proving to be MUCH more difficult:

document.getElementById("RadSchedulerRecurrenceEditor1_WeeklyWeekDaySaturday").checked = false;


When I replace with $find, it says it is not declared. Any assistance with locating this sub-object within DNN would be greatly appreciated.

Thanks,
Kerry
0
Accepted
Plamen
Telerik team
answered on 22 Aug 2013, 12:08 PM
Hi Kerry,

 
You can try finding the real ids with the help of jQuery as in the code below:

function pageLoad() {
               var $ = $telerik.$;
               var a = $("[id$='HiddenField1']");
               var hiddenField = document.getElementById(a.attr("id"));
               if (hiddenField.value == "false") {
                   var WeeklyWeekDaySaturdayObject = $("[id$='_WeeklyWeekDaySaturday']");
                   document.getElementById(WeeklyWeekDaySaturdayObject.attr("id")).checked = false;
               }
               $(".rsAdvWeekly ul li").click(function myfunction(e) {
                   if ((this.textContent) == "Saturday") {
                       if (e.target.checked) {
                           hiddenField.value = "true";
                       }
                       else {
                           hiddenField.value = "false";
                       }
                   }
               });
 
           }

Hope this will be helpful.

Regards,
Plamen
Telerik
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 the blog feed now.
Tags
Scheduler
Asked by
Kerry
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Kerry
Top achievements
Rank 1
Share this question
or