O'Reilly logo

Building Mobile Applications Using Kendo UI Mobile and ASP.NET Web API by Ragini Kumbhat Bhandari, Nishanth Nair

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The Switch widget

Switch is a common UI element on mobile devices which is used for binary on/off or true/false data input. The Switch widget can either be tapped or dragged to toggle its value.

The Kendo Mobile Switch widget is created by transforming an HTML checkbox. The checked property will get or set the checked/unchecked state of the widget. The label for a checked state is set using the onLabel property and the offLabel property sets the unchecked state's label.

The check() method gets and sets the checked state of the widget and the toggle() method toggles the checked state. When the checked state of the widget is changed, the change event is fired.

Initialization

Now let's see different ways of initializing the Switch widget:

Data attribute ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required