RadDatePicker set_enabled() javascrip doesn't work?

7 posts, 0 answers
  1. duc
    duc avatar
    1 posts
    Member since:
    Feb 2009

    Posted 24 Feb 2009 Link to this post

    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.
  2. Pavel
    Admin
    Pavel avatar
    904 posts

    Posted 04 Mar 2009 Link to this post

    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.
  3. Stuart
    Stuart avatar
    9 posts
    Member since:
    May 2009

    Posted 13 May 2009 Link to this post

    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.

     

  4. Pavel
    Admin
    Pavel avatar
    904 posts

    Posted 14 May 2009 Link to this post

    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.
  5. Stuart
    Stuart avatar
    9 posts
    Member since:
    May 2009

    Posted 14 May 2009 Link to this post

    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.

     

  6. Baal
    Baal avatar
    47 posts
    Member since:
    Mar 2008

    Posted 15 Jun 2009 Link to this post

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

    Posted 17 Jun 2009 Link to this post

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