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

Trying to get .data("kendoDateTimePicker") on declaratively initialized element

2 Answers 66 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
100%
Top achievements
Rank 1
100% asked on 21 Feb 2014, 10:33 AM
I am initializing a datetimepicker element declaratively like this:

<input id="foo" name="start" type="text" data-role="datetimepicker" />

when I later on try to get a refence to the datetimepicker object, I use

var dtp = $('#foo').data('kendoDateTimePicker');

but all I get is null. How come?

2 Answers, 1 is accepted

Sort by
0
100%
Top achievements
Rank 1
answered on 21 Feb 2014, 10:47 AM
It seems like the only key I have in .data is "role" which is "datetimepicker".
0
Accepted
Atanas Korchev
Telerik team
answered on 21 Feb 2014, 12:31 PM
Hi,

The code you have shown looks correct. Here is a live demo that show a running version of it: http://jsbin.com/jepowazi/1/edit

Regards,
Atanas Korchev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Date/Time Pickers
Asked by
100%
Top achievements
Rank 1
Answers by
100%
Top achievements
Rank 1
Atanas Korchev
Telerik team
Share this question
or