Universal Kendo UI Mobile App

Method for initializing a phone or tablet app depending on the platform with Kendo UI Mobile

by newblt123

HTML

<link rel="stylesheet" href="http://cdn.kendostatic.com/2012.2.621/styles/kendo.mobile.all.min.css">
<script src="http://cdn.kendostatic.com/2012.2.621/js/kendo.all.min.js"></script>
<div id="phoneApp" style="display:none;">
<div id="forms" data-role="view">
    <ul data-role="listview" data-style="inset">
        <li>
            Montant
            <input type="number" id="expenseaccount-amount-fr" value="0" />
        </li>
        
        <li>
            Description
            <textarea id="expenseaccount-decsription-fr" style="resize:none;"></textarea>
        </li>
    </ul>
</div>
</div>

CSS

body, html {
 margin: 0;   
    height: 100%;
    width: 100%;
}

textarea {
    width: 300px;
    resize: none;
    float: right;
}

input {
    width: 300px !important;
    margin-right:15px;
}

JavaScript

$(function() {
    var app;

    app = new kendo.mobile.Application($("#phoneApp"), {
        layout: "phoneDefault",
        transition: 'slide'
    });
    
    //Adjust visibility of proper app container
    $("#phoneApp").show();
});