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

DatePicker - get_selectedDate() error

3 Answers 102 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
JH
Top achievements
Rank 1
JH asked on 17 Nov 2010, 05:40 PM
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

3 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 17 Nov 2010, 10:57 PM
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.
0
JH
Top achievements
Rank 1
answered on 19 Nov 2010, 10:37 AM
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
0
Daniel
Telerik team
answered on 19 Nov 2010, 09:56 PM
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.
Tags
Calendar
Asked by
JH
Top achievements
Rank 1
Answers by
Daniel
Telerik team
JH
Top achievements
Rank 1
Share this question
or