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

RadDatePicker set_enabled() javascrip doesn't work?

6 Answers 308 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
duc
Top achievements
Rank 1
duc asked on 25 Feb 2009, 02:37 AM
It does work given the example at: http://www.telerik.com/help/aspnet-ajax/calendar_clientsidebasics.html

But it doesn't work if the RadDatePicker is default to disabled (Enabled="false") at startup. I am using a SharedCalendar control.

What it look like at startup when disabled:
1. Input is disabled (gray out).
2. Calendar icon/button is faded (it has a fade to it so that it looks disabled).

What it look like after "set_enabled(true)" is called:
1. Input is enabled (but the empty text is gray when the mouse is over it ... suppose to be black).
2. Calendar icon/button remain faded (unable to click it to show the pop up calendar).

Like I said, I'm able to get it to work if the control is default to enable at startup just like the example.

Edit: Same issue posted with workaround - http://www.telerik.com/community/forums/aspnet-ajax/calendar/enable-datepicker-in-javascript.aspx

I did come with a similar workaround (initialize the "disable" of the control by javascript at startup) stated in that post but still isn't an ideal solution.

6 Answers, 1 is accepted

Sort by
0
Pavel
Telerik team
answered on 04 Mar 2009, 07:56 AM
Hello Duc,

I am afraid that currently we do not support disabling the DatePicker on the server and then enabling it on the client. Please excuse us for this inconvenience.

Regards,
Pavel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Stuart
Top achievements
Rank 1
answered on 13 May 2009, 02:55 PM
Hi,

OK, I'm using a RadGrid with an EditForm which contains a RadDatePicker. I'm disabling the date picker in the ItemDataBound on the server depending on the values in the other databaound controls. I then need to enable the datepicker if its needed, I'm trying to do this in javascript using the set_enabled method which as you say isn't supported.

Is there a way in which I can enable/disable to datepicker in javascipt then instead of using the ItemDataBound event? Or is there something other than the Enabled propery which I can set on the server which would do something similar? I really need a work around to this.

 

0
Pavel
Telerik team
answered on 14 May 2009, 11:17 AM
Hello Stuart,

I have prepared a small sample which illustrates one approach to disable/enable the DatePicker located in a Grid edit form. Try it out and let me know if it meets your requirements.

Sincerely yours,
Pavel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Stuart
Top achievements
Rank 1
answered on 14 May 2009, 03:34 PM
Thanks, that worked except when the edit row was being closed the javascript function was being called but not finding the date picker so I changed the function to:

String

 

.Format("function pageLoad(){{var ctl = $find('{0}'); if(ctl != null) {{ ctl.set_enabled(false);ctl.get_popupButton().className = \"rcCalPopup rcDisabled\";}}}}",

Thanks again, Stuart.

 

0
Baal
Top achievements
Rank 1
answered on 15 Jun 2009, 02:28 PM
Wanted to bump this thread. The criteria the OP mentioned is still valid. If the RadDatePicker is disabled during page load, the set_enabled method does not work properly.

Thanks.
0
Dimo
Telerik team
answered on 17 Jun 2009, 10:52 AM
Hi Baal,

Indeed, the issue still exists. It is in our to-do list and will be researched thoroughly soon. We will do our best to provide a fix for some of the coming versions of RadControls.

Kind regards,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Calendar
Asked by
duc
Top achievements
Rank 1
Answers by
Pavel
Telerik team
Stuart
Top achievements
Rank 1
Baal
Top achievements
Rank 1
Dimo
Telerik team
Share this question
or