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

Mobile button bound to observable (MVVM)

2 Answers 70 Views
Button (Mobile)
This is a migrated thread and some comments may be shown as answers.
Jeremy Wiebe
Top achievements
Rank 1
Jeremy Wiebe asked on 12 Sep 2012, 10:05 PM
I am trying to bind a Kendo mobile button to a javascript model (kendo.observable).  I'd like to have the button disabled until the model says everything is valid.  

I've created a small jsFiddle that shows my problem.   Should the mobile button be "bindable" to a kendo observable model?

http://jsfiddle.net/jeremy_wiebe/SxYCb/ 

Thanks,

2 Answers, 1 is accepted

Sort by
0
Alex
Top achievements
Rank 1
answered on 14 Sep 2012, 09:44 AM
In my project I do:

<button data-role="button" data-bind="enabled:canClick">Caption</button>

see also
http://www.kendoui.com/forums/mobile/button/how-to-disable-mobile-button-suggestion.aspx 
0
Jeremy Wiebe
Top achievements
Rank 1
answered on 16 Sep 2012, 11:44 AM
Thanks Alex.  Using a <button> works great.  

I'd be curious to hear from the Kendo team why they choose to use <a /> for the Kendo Mobile button instead of the native <button>.  Perhaps better control over styling?  I also looked through the code and I can't figure out exactly how you'd disable the <a /> button in the binders.
Tags
Button (Mobile)
Asked by
Jeremy Wiebe
Top achievements
Rank 1
Answers by
Alex
Top achievements
Rank 1
Jeremy Wiebe
Top achievements
Rank 1
Share this question
or