Date Picker handler not available in AngularJS directive

5 posts, 0 answers
  1. Pablo
    Pablo avatar
    3 posts
    Member since:
    Dec 2014

    Posted 08 Dec 2014 Link to this post

    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
  2. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2566 posts

    Posted 10 Dec 2014 Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
  4. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2566 posts

    Posted 10 Dec 2014 Link to this post

    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!
     
  5. Pablo
    Pablo avatar
    3 posts
    Member since:
    Dec 2014

    Posted 12 Dec 2014 in reply to Kiril Nikolov Link to this post

    Thanks, kendoWidgetCreated did the trick.
  6. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2566 posts

    Posted 15 Dec 2014 Link to this post

    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!
     
Back to Top
Kendo UI is VS 2017 Ready