use data() with custom widget?

3 posts, 2 answers
  1. Stephen
    Stephen avatar
    11 posts
    Member since:
    Feb 2013

    Posted 31 Jul 2013 Link to this post

    I have created a custom widget based on the tutorial: http://docs.kendoui.com/howto/create-custom-kendo-widget

    if I try to do: $( '#widgetId' ).data( 'kendoMyCustomWidget' ).something(); 

    This doesn't work or:

    $( '#widgetId' ).data( 'MyCustomWidget' ).something(); 

    This is how the kendoWindow API example references internal methods and I would like to be able to do this also.

    Any ideas?


    Thanks.


  2. Answer
    Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 31 Jul 2013 Link to this post

    Hi Stephen,

    The tutorial should be sufficient to implement a custom widget. Here is a live demo showing that:

    http://jsbin.com/izaked/1/edit

    If you need further assistance please provide your code so we can take a look.

    Regards,
    Atanas Korchev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Answer
    Stephen
    Stephen avatar
    11 posts
    Member since:
    Feb 2013

    Posted 31 Jul 2013 Link to this post

    It appears that I was calling data() before the object was created! My bad!

    Thanks for the quick response.
Back to Top