Clientside DatePicker Enable/Disable

5 posts, 0 answers
  1. Oziem
    Oziem avatar
    17 posts
    Member since:
    Nov 2006

    Posted 17 Dec 2008 Link to this post

    Hi,

    We are trying to enable/disable a datePicker control.  But unfortunately the following commands don't exist;

    $find('control').enable();
    $find('control').disable();

    We have worked out from a previous thread that we can enable/disable the inputbox part using;

    $find('control').get_dateInput().enable();
    $find('control').get_dateInput().disable();
    How can we enable/disable the popup calendar?  In the past we used something like;

    control.PopupButton.onclick = null;
    control.PopupButton.onclick = function(){control.TogglePopup();return false;};
    Have tried the below with no success;

    $find('control').get_popupButton().onclick = null;
    Thanks
  2. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 17 Dec 2008 Link to this post

    Hello Oziem,

    Please refer to the following forum post, in which sample application showing this functionality is provided. Test it on your side and let us know if it helps.

    Greetings,
    Maria Ilieva
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Oziem
    Oziem avatar
    17 posts
    Member since:
    Nov 2006

    Posted 17 Dec 2008 Link to this post

    Thanks.

    Might I suggest a slightly better way incase you have multiple datepickers on a page;

    function OnOpenDatePopup(sender, eventArgs) 
            var di = sender.get_dateInput(); 
            eventArgs.set_cancel(!di.get_enabled()); 

    <telerik:RadDatePicker ID="RadDatePicker1" runat="server"
          <ClientEvents OnPopupOpening="OnOpenDatePopup" /> 
    </telerik:RadDatePicker> 

  4. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 17 Dec 2008 Link to this post

    Hello Oziem,

    Thank you for sharing your optimized version in this public forum post - thus other community members can benefit from it as well. I updated your Telerik points for the feedback.

    Best regards,
    Sebastian
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. Tom Jaspering
    Tom Jaspering avatar
    34 posts
    Member since:
    May 2006

    Posted 08 May 2009 Link to this post

    Get the Latest build and use set_enabled(false) of the DatePicker client object to disable it.
Back to Top