Hi! Could you provide me small example to bind model member (boolean) to Switch widget state.
I would expect something like
But it looks terrible and does not work. Another question: why after binding my Tabstrip looks "doubled"
http://jsfiddle.net/GewUa/5/
I would expect something like
<
input
data-role
=
"switch"
data-bind
=
"checked:checked"
/>
But it looks terrible and does not work. Another question: why after binding my Tabstrip looks "doubled"
http://jsfiddle.net/GewUa/5/
9 Answers, 1 is accepted
0
Accepted
Hello Alex,
Georgi Krustev
the Telerik team
The switch widget is initialized twice, which is not supported. I will suggest you use the data-model attribute.
Here is the updated jsFiddle demo.
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Eric
Top achievements
Rank 1
answered on 09 Mar 2014, 07:50 PM
What if you have a view with a form and because of the requirements cannot use the data-model attribute to bind the information to the view, but instead bind it as Alex shows it during data-before-show or data-show? How can you bind to a switch correctly declaratively? How can you make it so that the switch does not get initialized twice?
Please, advise!
Please, advise!
0
Hi,
You can use View's init event to bind the view's content. Check the updated jsFiddle demo.
Regards,
Georgi Krustev
Telerik
You can use View's init event to bind the view's content. Check the updated jsFiddle demo.
Regards,
Georgi Krustev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Amitesh
Top achievements
Rank 2
answered on 02 Apr 2014, 01:53 AM
Hi Georgi,
The binding for the switch on the demo actually is not working.
Regards,
Ikhwan
The binding for the switch on the demo actually is not working.
Regards,
Ikhwan
0
Hello,
Indeed, the binding does not work, because I missed to specify a namespace. Here is the correctly defined kendo.bind method call. Please note, that the preferred way to bind a Mobile View is using the data-model attribute.
Regards,
Georgi Krustev
Telerik
Indeed, the binding does not work, because I missed to specify a namespace. Here is the correctly defined kendo.bind method call. Please note, that the preferred way to bind a Mobile View is using the data-model attribute.
Regards,
Georgi Krustev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Mike
Top achievements
Rank 1
answered on 19 Jul 2016, 03:31 PM
Your link to "the data-model attribute" is broken.
Is it supposed to be linked here? http://docs.telerik.com/kendo-ui/api/javascript/data/model
If so, can we see an example of the "correct" way to bind the switch control?
0
Hello Mike,
The "data-model" link was supposed to point the readers to the correct way to bind Mobile View:
http://docs.telerik.com/kendo-ui/api/javascript/mobile/ui/view#configuration-model
As to how a slider can be bound to MVVM model, then I would suggest you examine our online demo and the corresponding MVVM value binding documentation:
http://docs.telerik.com/kendo-ui/framework/mvvm/bindings/value
http://demos.telerik.com/kendo-ui/slider/mvvm
Regards,
Georgi Krustev
Telerik by Progress
The "data-model" link was supposed to point the readers to the correct way to bind Mobile View:
http://docs.telerik.com/kendo-ui/api/javascript/mobile/ui/view#configuration-model
As to how a slider can be bound to MVVM model, then I would suggest you examine our online demo and the corresponding MVVM value binding documentation:
http://docs.telerik.com/kendo-ui/framework/mvvm/bindings/value
http://demos.telerik.com/kendo-ui/slider/mvvm
Regards,
Georgi Krustev
Telerik by Progress
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
0
Running
Top achievements
Rank 1
answered on 27 Jun 2018, 10:38 PM
This post is about the kendo switch. Why is the Admin posting links to the slider widget? Is there any complete documentation on how to use the SWITCH widget with MVVM?
0
Hello,
For your convenience, following is a dojo example with MVVM initialization of the MobileSwitch:
Hope this helps.
Regards,
Konstantin Dikov
Progress Telerik
For your convenience, following is a dojo example with MVVM initialization of the MobileSwitch:
Hope this helps.
Regards,
Konstantin Dikov
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which
deliver the business app essential building blocks - a grid component,
data visualization (charts) and form elements.