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

use data() with custom widget?

2 Answers 53 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Stephen
Top achievements
Rank 1
Stephen asked on 31 Jul 2013, 01:31 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Atanas Korchev
Telerik team
answered on 31 Jul 2013, 02:43 PM
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!
0
Accepted
Stephen
Top achievements
Rank 1
answered on 31 Jul 2013, 03:09 PM
It appears that I was calling data() before the object was created! My bad!

Thanks for the quick response.
Tags
General Discussions
Asked by
Stephen
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Stephen
Top achievements
Rank 1
Share this question
or