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

Custom Widget Plugins questions

4 Answers 87 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Joshua
Top achievements
Rank 1
Joshua asked on 12 Apr 2012, 03:52 PM
Greetings.

My company's flagship product is currently built on jQuery and KendoUI, with all our plugins using the standard jQuery style. I am in the process of converting them to use the KendoUI plugin style outlined in the recent blog posts, so we can take advantage of the new MVVM features. That said, the blog posts showing how to write KendoUI plugins leave out how to do the following:

  1. Events: I assume we are supposed to use the "widgetData.bind('event', handler)" style for externally facing events. I just want to know how I should bind and trigger my custom events for my plugins? Also, for internal events should I keep using the jQuery style  "scopeSelector.on('event', 'elementSelector', handler"?
  2. Declaractive style & Data Sources: What does my plugin need in order to hook up to data-sources and references provided by "source" and "value" tags from the new declarative style of plugin initialization? 
Thanks for any help you can provide.

4 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 12 Apr 2012, 04:18 PM
Hello,

 We have published a few blog posts which discuss this matter:
http://www.kendoui.com/blogs/teamblog/posts/12-04-03/creating_custom_kendo_ui_plugins.aspx 
http://www.kendoui.com/blogs/teamblog/posts/12-04-10/creating_a_datasource_aware_kendo_ui_widget.aspx 

Adding support for MVVM is also a topic which we will cover in a blog post. Stay tuned!

Regards,
Atanas Korchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Joshua
Top achievements
Rank 1
answered on 12 Apr 2012, 04:25 PM
Yes, those are the blog entries I mentioned in my first post. The problem is, neither one covers setting up or triggering events for custom Kendo plugins. I know how to handle the setup, but how do I trigger KendoUI style events? Is there something like the jQuery call "scopeSelector.trigger('event')"?
0
Atanas Korchev
Telerik team
answered on 12 Apr 2012, 04:30 PM
Hello,

 The upcoming blog post will show how to trigger widget events. However the code is really simple:

var eventArgs = {
    foo: "bar";
};
 
this.trigger("eventName", eventArgs);

Where "this" is the widget instance. 

For handling DOM events you could use jQuery bind, on or delegate.

Kind regards,

Atanas Korchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Joshua
Top achievements
Rank 1
answered on 12 Apr 2012, 04:34 PM
Awesome! Thanks for the help. ;)

I suppose I should have waited for the blog post, but I am so excited to be using the new tech that it is kind of hard to wait. :p
Tags
General Discussions
Asked by
Joshua
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Joshua
Top achievements
Rank 1
Share this question
or