Use the Mobile Switch within regular MVVM framework

3 posts, 1 answers
  1. Erik
    Erik avatar
    50 posts
    Member since:
    Jan 2011

    Posted 06 Feb Link to this post

    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. Answer
    Tsvetina
    Admin
    Tsvetina avatar
    2087 posts

    Posted 08 Feb Link to this post

    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.
  3. Erik
    Erik avatar
    50 posts
    Member since:
    Jan 2011

    Posted 08 Feb Link to this post

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

    Have a great day!

    -Erik

Back to Top