The Button widget navigates between mobile Application views when pressed.
The Kendo mobile Application will automatically initialize a mobile Button for every element with role data attribute set to button present in the views/layouts' markup.
Alternatively, it can be initialized using a jQuery selector. The button element may be either A or BUTTON.
<a href="#foo" data-role="button">Foo</a>var button = $("#button").kendoMobileButton();The Kendo mobile Button color can be customized by setting its background-color CSS property inline or by using a CSS selector with specificity of 20+.
You can target platforms separately with their respective root CSS classes.
<a href="#foo" data-role="button" style="background-color: green">Foo</a><style>
.km-ios .checkout { background-color: green; }
.km-android .checkout { background-color: red; }
</style>
<a href="#foo" data-role="button" class="checkout">Foo</a>A Button icon can be set in two ways - either by adding an img element inside the Button element,
or by setting an icon data attribute to the Button element.
KendoUI Mobile comes out of the box with several ready to use icons:
Additional icons may be added by defining the respective CSS class.
If the icon data attribute is set to custom, the tab will receive km-custom CSS class.
<style>
.km-custom {
background-image: url("foo.jpg");
}
</style>
<div data-role="button">
<a href="#index" data-icon="custom">Home</a>
</div><a data-role="backbutton">Foo</a>var button = $("#button").kendoMobileBackButton();<a data-role="detail-button">Foo</a>var button = $("#button").kendoMobileDetailButton();