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

Binding problem using Toolbar

3 Answers 100 Views
MVVM
This is a migrated thread and some comments may be shown as answers.
Marcel
Top achievements
Rank 1
Marcel asked on 14 Aug 2014, 10:14 AM
Hello,

Due to the introduction of the Toolbar i decided to replace my own toolbars with the Kendo Toolbars.
This all went fine, except now i have a problem with updating the viewmodel.

If i change the value of a data-bound input and click (for example) the save button on the Toolbar,
the blur event of that input never gets called and thus the viewmodel won't be updated.

If i use a KendoButton outside of the Toolbar i have no problems, since the focus changes to the KendoButton and the blur event of the input gets triggered.

I included a jsFiddle to show you what i mean.
http://jsfiddle.net/6mrmb40k/

- Change the value of the input and click the save button on the toolbar.
- Change the value of the input and click the save button outside the toolbar.

Any ideas how to fix this ?

Thanks in advance.

3 Answers, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 18 Aug 2014, 08:49 AM
Hi Marcel,

The issue occurs because the ToolBar event handlers prevent the mousedown event and as a result the input does not fire its change event.
We will add a build-in solution for that issue in the next internal build, meanwhile you may use the data-value-update attribute to tell the MVVM to update the value when the "input" event occurs. The input event is not affected by the mousedown event.

<input class="k-textbox" data-value-update="input" data-bind="value: text"/>

Here is a link to the updated jsFiddle version:  http://jsfiddle.net/6mrmb40k/1/

Regards,
Alexander Valchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Marcel
Top achievements
Rank 1
answered on 25 Aug 2014, 11:41 AM
Hey Alexander,

Although not mentioned in de build notes of the lastest internal build, apparently it is indeed fixed.
Thanks for that.

Regards.
0
Alexander Valchev
Telerik team
answered on 26 Aug 2014, 01:04 PM
Hi Marcel,

Yes the fix was included in the latest internal build. We will investigate why the release notes were not updated.

Regards,
Alexander Valchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
MVVM
Asked by
Marcel
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Marcel
Top achievements
Rank 1
Share this question
or