Kendo UI Grid Mobile Scrolling
... restricting scrolling to 1 direction (no diagonal scrolling)
HTML
<script src="http://cdn.kendostatic.com/2014.1.318/js/kendo.all.min.js"></script>
<link rel="stylesheet" href="http://cdn.kendostatic.com/2014.1.318/styles/kendo.common.min.css">
<link rel="stylesheet" href="http://cdn.kendostatic.com/2014.1.318/styles/kendo.uniform.min.css">
<div id="container">
<div id="grid"></div>
</div>
<div id="status"></div>
CSS
#container {
max-width: 400px;
}
#status {
font-family: "Courier New", Courier, monospace;
}
JavaScript
var firstNames = ["Nancy", "Andrew", "Janet", "Margaret", "Steven", "Michael", "Robert", "Laura", "Anne", "Nige"],
lastNames = ["Davolio", "Fuller", "Leverling", "Peacock", "Buchanan", "Suyama", "King", "Callahan", "Dodsworth", "White"],
cities = ["Seattle", "Tacoma", "Kirkland", "Redmond", "London", "Philadelphia", "New York", "Seattle", "London", "Boston"],
titles = ["Accountant", "Vice President, Sales", "Sales Representative", "Technical Support", "Sales Manager", "Web Designer",
"Software Developer", "Inside Sales Coordinator", "Chief Techical Officer", "Chief Execute Officer"],
birthDates = [new Date("1948/12/08"), new Date("1952/02/19"), new Date("1963/08/30"), new Date("1937/09/19"), new Date("1955/03/04"), new Date("1963/07/02"), new Date("1960/05/29"), new Date("1958/01/09"), new Date("1966/01/27"), new Date("1966/03/27")];
function createRandomData(count) {
var data = [], now = new Date();
for (var i = 0; i < count; i++) {
data.push({
Id: i + 1,
FirstName: firstNames[Math.floor(Math.random() * firstNames.length)],
LastName: lastNames[Math.floor(Math.random() * lastNames.length)],
City: cities[Math.floor(Math.random() * cities.length)],
Title: titles[Math.floor(Math.random() * titles.length)],
BirthDate: birthDates[Math.floor(Math.random() * birthDates.length)]
});
}
return data;
}
$(document).ready(function() {
$("#grid").kendoGrid({
dataSource: {
data: createRandomData(20),
schema: {
model: {
fields: {
FirstName: { type: "string" },
LastName: { type: "string" },
City: { type: "string" },
Title: { type: "string" },
BirthDate: { type: "date" },
Age: { type: "number" }
}
}
...