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

Writing plugin to expose custom widget events to declarative style

0 Answers 86 Views
MVVM
This is a migrated thread and some comments may be shown as answers.
Joshua
Top achievements
Rank 1
Joshua asked on 05 Jun 2012, 12:55 PM
Is there some trick to exposing events in kendo-style plugins so that I can bind them using the declarative style? Currently I am just establishing the events on my plugins using the reserved "events" array field, using strings for their names. I thought that was enough, but when I attempt to bind them with the declarative style it keeps saying "Uncaught TypeError: Cannot read property 'change' of undefined". Any input on this?

Code examples: 
From plugin:
events: [
"error",
"change"
 ],

From declaration:
<div data-role="pluginname" data-bind="events: { change: testChange }"></div>

Where the plugin itself has been tested and is found by the bind, and the function "testChange" exists in the viewModel.

No answers yet. Maybe you can help?

Tags
MVVM
Asked by
Joshua
Top achievements
Rank 1
Share this question
or