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

Edit the OnPopupOpening event of the RadDatePicker

2 Answers 68 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Huzeifa Nabijee
Top achievements
Rank 1
Huzeifa Nabijee asked on 03 Sep 2009, 06:57 AM
Hello guys,

Im created an OnPopupOpening event for my Calendar control so that when a user clicks on the calendar control, i fire some javascript to control a few radio buttons on the page. The code ive got so far is :

<telerik:RadDatePicker id="radLastApplication" runat="server">
         <ClientEvents OnPopupOpening="setRadioButtonsOnPage();" />
</telerik:RadDatePicker>
 <script type="text/javascript">
       Telerik.Web.UI.Calendar.Popup.prototype.OnClick = function(e) {
            this.Opener.hidePopup();
       }  
 </script>

However with this code, my javascript fires correctly but the calendar wont display!! how can i get the calendar to display as well as fire my little javascript code too?

any help would be greatly appreciated!!

Cheer
Zef

2 Answers, 1 is accepted

Sort by
0
Accepted
Dimo
Telerik team
answered on 03 Sep 2009, 11:25 AM
Hello Zef,

First of all, the value of the OnPopupOpening property should be a method name without brackets and a semi-colon:

<ClientEvents OnPopupOpening="setRadioButtonsOnPage" />

Your code snippet works correctly on my side (if I remove the above line, as I don't have the event handler anyway).

Why do you override the Telerik.Web.UI.Calendar.Popup type internal OnClick method?

Kind regards,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Huzeifa Nabijee
Top achievements
Rank 1
answered on 04 Sep 2009, 12:50 AM
Hello,

Thanks for your reply. Thats much appreciated.

You are right. I didnt need to override the Popup type internal OnClick Method. I removed it and the following code work like a charm.

<telerik:RadDatePicker id="radLastApplication" runat="server">
        <ClientEvents OnPopupOpening="setRadioButtonsOnPage"
</telerik:RadDatePicker>

Cheers
Zef
Tags
Calendar
Asked by
Huzeifa Nabijee
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Huzeifa Nabijee
Top achievements
Rank 1
Share this question
or