Edit the OnPopupOpening event of the RadDatePicker

3 posts, 1 answers
  1. Huzeifa Nabijee
    Huzeifa Nabijee avatar
    2 posts
    Member since:
    May 2009

    Posted 03 Sep 2009 Link to this post

    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. Answer
    Dimo
    Admin
    Dimo avatar
    8454 posts

    Posted 03 Sep 2009 Link to this post

    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.
  3. Huzeifa Nabijee
    Huzeifa Nabijee avatar
    2 posts
    Member since:
    May 2009

    Posted 03 Sep 2009 Link to this post

    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
Back to Top