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

Use the Mobile Switch within regular MVVM framework

2 Answers 104 Views
Switch (Mobile)
This is a migrated thread and some comments may be shown as answers.
Erik
Top achievements
Rank 2
Erik asked on 06 Feb 2017, 07:54 PM

Hi --

I've been trying to get a "switch" of any kind to work with the regular MVVM framework -- it's a full desktop web application (not the mobile flavor).

I have tried including the mobile css, creating a new kendo.mobile.application, but nothing seems to work. 

Do you have any examples of the mobile switch being used in a non-mobile application and using the MVVM framework?  I'd love to see the code in a JsFiddle or something.

If you need it, I can try to create a non-working fiddle with what I'm after -- but it's really just a multi-field form, where one/more of the fields is a switch -- and uses the MVVM framework and NOT a mobile application.

Any assistance is appreciated -

Erik

2 Answers, 1 is accepted

Sort by
0
Accepted
Tsvetina
Telerik team
answered on 08 Feb 2017, 12:29 PM
Hi Erik,

Kendo UI Mobile is not included in the default list of initialized namespaces when using MVVM. This is noted in the docs here. I guess that you have web widgets as well in this view, so instead of adjusting your kendo.bind call for the mobile framework, you can use the fully qualified Switch name (kendo.mobile.ui.Switch) to trigger its initialization from the correct library:
<input data-role="kendo.mobile.ui.Switch" data-bind="value: confirmed"/>

You can see a simple Dojo here: http://dojo.telerik.com/@tsveti/uxaze/2.

Regards,
Tsvetina
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Erik
Top achievements
Rank 2
answered on 08 Feb 2017, 03:34 PM

You are awesome, Tsvetina!!!!  This is just what I needed.  Thanks for pointing me in the right direction.

Have a great day!

-Erik

Tags
Switch (Mobile)
Asked by
Erik
Top achievements
Rank 2
Answers by
Tsvetina
Telerik team
Erik
Top achievements
Rank 2
Share this question
or