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

Clientside DatePicker Enable/Disable

4 Answers 103 Views
Input
This is a migrated thread and some comments may be shown as answers.
Oziem
Top achievements
Rank 2
Oziem asked on 17 Dec 2008, 01:42 PM
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

4 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 17 Dec 2008, 01:49 PM
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.
0
Oziem
Top achievements
Rank 2
answered on 17 Dec 2008, 02:04 PM
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> 

0
Sebastian
Telerik team
answered on 17 Dec 2008, 02:12 PM
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.
0
Tom Jaspering
Top achievements
Rank 1
answered on 08 May 2009, 06:40 PM
Get the Latest build and use set_enabled(false) of the DatePicker client object to disable it.
Tags
Input
Asked by
Oziem
Top achievements
Rank 2
Answers by
Maria Ilieva
Telerik team
Oziem
Top achievements
Rank 2
Sebastian
Telerik team
Tom Jaspering
Top achievements
Rank 1
Share this question
or