mobilekendo-uiswitch-statement

KendoUI: Mix Web and Mobile Widgets in Web Application


Has anybody successfully used any of the KendoUI mobile widgets in a Web Application? I have an site using the Kendo Web library. I would like to use the Switch widget from the mobile library.

I've added code like this:

<div id="mobBody" style="width:50px;height:30px">
 <input id="wink-switch" data-role="view" />
</div>

I create the widget as normal:

$("#wink-switch").kendoMobileSwitch();

The widget actually works at this point, the problem is it is not presented at all correctly. In order to get it to presnt correctly I need to do:

 <script>
 var switD = document.getElementById("mobBody");

 var app = new kendo.mobile.Application(switD); </script>

However this has many undesirable affects on the remainder of the application.


Solution

  • This currently won't work nicely. The Kendo UI Mobile widgets work only in a Kendo UI Mobile application for now. This behaviour is going to change soon though so you could use the switch widget without a mobile application. This feature will land with the Q1 2014 release which is expected in March 2014.