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

Kendo Mobile Switch not updating viewModel

3 Answers 151 Views
MVVM
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Richard asked on 17 Jun 2012, 03:15 AM
When I use a checkbox it will update my view model no problem, but when I turn on data-role="switch" it no longer updates. Is there something I need to do differently.

3 Answers, 1 is accepted

Sort by
0
d2uX
Top achievements
Rank 1
answered on 19 Jul 2012, 01:44 PM
How did you bind your data to the switch?
0
Alexander Valchev
Telerik team
answered on 24 Jul 2012, 09:18 AM
Hi Richard,

When you add a data-role="switch" attribute to the input kendo mobile application will initialize a widget. In order to monitor its state you can hook up to to the change event of the component via data-change attribute.
<input id="foo" data-role="switch" data-change="isChecked" />
 
function isChecked(e) {
    //change event
}

I hope this helps.

Kind regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Running
Top achievements
Rank 1
answered on 27 Jun 2018, 09:54 PM
This is false. Refer to this post for the accurate way of initializing a Switch widget https://www.telerik.com/forums/use-the-mobile-switch-within-regular-mvvm-framework
Tags
MVVM
Asked by
Richard
Top achievements
Rank 1
Answers by
d2uX
Top achievements
Rank 1
Alexander Valchev
Telerik team
Running
Top achievements
Rank 1
Share this question
or