DatePicker - get_selectedDate() error

4 posts, 0 answers
  1. JH
    JH avatar
    25 posts
    Member since:
    Jan 2010

    Posted 17 Nov 2010 Link to this post

    Hi,

    I've got a really simple situation here that is malfunctioning for some reason..
    I've got a RadDatePicker :

    <telerik:RadDatePicker ID="datePicker" runat="server" (...) />

    And some simple javascript that is running when I press a button:

    var datePickerElem = $('#<%= datePicker.ClientID %>').get(0);
    var currDate = datePickerElem.get_selectedDate();

    The object is found properly, but I get the exception "Microsoft JScript runtime error: Object doesn't support this property or method" when calling get_selectedDate(). Any idea of what's wrong?

    BR
  2. Daniel
    Admin
    Daniel avatar
    4949 posts

    Posted 17 Nov 2010 Link to this post

    Hello JH,

    I recommend that you use the $find method in order to get the RadDatePicker's client object.
    var datePickerElem = $find('<%= datePicker.ClientID %>');
    var currDate = datePickerElem.get_selectedDate();

    Alternatively, you could use the findControl method, available in our client-side static library:
    Telerik static client library

    Regards,
    Daniel
    the Telerik team
    Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  3. JH
    JH avatar
    25 posts
    Member since:
    Jan 2010

    Posted 19 Nov 2010 Link to this post

    Thanks.
    I also noticed that I get "switch" between the DOM object and the control via "element.control" and "control.get_element()" as well, which works fine :)

    Just a side-question.. Will you upgrade the internal jquery build used to 1.4.4 in the near future? 1.4.3 was apparently a very buggy release of jquery. To improve performance, I use "var jQuery = window.jQuery = window.$ = $telerik.$;" and therefore wonder what your strategy is regarding new jquery releases?

    BR
  4. Daniel
    Admin
    Daniel avatar
    4949 posts

    Posted 19 Nov 2010 Link to this post

    Hello JH,

    jQuery 1.4.4 will be integrated in the next release of RadControls. You could test it right now if you download the Latest Internal Build.

    Best regards,
    Daniel
    the Telerik team
    Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Back to Top