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

Date Picker handler not available in AngularJS directive

4 Answers 49 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
Pablo
Top achievements
Rank 1
Pablo asked on 08 Dec 2014, 07:55 PM
I have two KendoDatePicker's in an AngularJS directive (this is the example). The handler of the first one is called "picker" and the second one "picker2". If I click on the "Open" button, I can open the calendar of "picker" with scope.picker.open(). However, if I run scope.picker2.open() when the directive is initialized (in the link function) I get the error "TypeError: Cannot read property 'open' of undefined" it seems that "picker2" is not available. Any idea why?


Thanks
Pablo

4 Answers, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 10 Dec 2014, 01:46 PM
Hello Pablo,

I was not able to open the plunkr that you shared, maybe you can extract it to a Kendo UI Dojo, so we can investigate it? I would also like to suggest you to take a look at the kendoWidgetCreated event, that you can use to determine when all the widgets are initialized. Here is the documentation about it:

http://docs.telerik.com/kendo-ui/AngularJS/global-events

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Kiril Nikolov
Telerik team
answered on 10 Dec 2014, 01:47 PM
Hello Pablo,

I was not able to open the plunkr that you shared, maybe you can extract it to a Kendo UI Dojo, so we can investigate it? I would also like to suggest you to take a look at the kendoWidgetCreated event, that you can use to determine when all the widgets are initialized. Here is the documentation about it:

http://docs.telerik.com/kendo-ui/AngularJS/global-events

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Pablo
Top achievements
Rank 1
answered on 12 Dec 2014, 12:32 PM
Thanks, kendoWidgetCreated did the trick.
0
Kiril Nikolov
Telerik team
answered on 15 Dec 2014, 09:38 AM
Hello Pablo,

I am happy that I helped.

In case you have any further questions, please do not hesitate to contact us.

Regards,
Kiril Nikolov
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
Pablo
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Pablo
Top achievements
Rank 1
Share this question
or