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

MVVM and binding events to Kendo UI Web Widgets

1 Answer 446 Views
MVVM
This is a migrated thread and some comments may be shown as answers.
Yhnavein
Top achievements
Rank 1
Yhnavein asked on 29 May 2012, 05:01 PM
Hi, how can I bind some simple event like 'change' on MVVM to any of KendoUI widgets?
Example:
<input type="text" id="txtHours" class="kendoNumeric input-mini" data-bind="value: hours, change: hoursChange" />

And this is exception in web browser:
Uncaught Error: The change binding is not supported by the NumericTextBox widget  

Binding events in similar matter for any other non-Kendo widget or controls works just fine.
Am I doing something wrong or binding just doesn't work for Kendo controls?

1 Answer, 1 is accepted

Sort by
0
Yhnavein
Top achievements
Rank 1
answered on 29 May 2012, 08:52 PM
Ok, I have finally found solution. There is an example for custom events bindings: 
http://www.kendoui.com/documentation/framework/mvvm/bindings/events.aspx 

Generally this solves my problem:
<input type="text" id="txtHours" class="kendoNumeric input-mini" data-bind="value: hours, events: {change: changeHours, spin: changeHours}" />

Whats interesting is that there are cases when my previous version works just fine - buttons. And that deceived me :)
Tags
MVVM
Asked by
Yhnavein
Top achievements
Rank 1
Answers by
Yhnavein
Top achievements
Rank 1
Share this question
or