Files
2022-11-04 13:24:24 +02:00

95 lines
2.8 KiB
HTML
Executable File

<!DOCTYPE html>
<html>
<head>
<title>Responsive Columns</title>
<meta charset="utf-8">
<link href="../content/shared/styles/examples-offline.css" rel="stylesheet">
<link href="../../styles/kendo.common.min.css" rel="stylesheet">
<link href="../../styles/kendo.rtl.min.css" rel="stylesheet">
<link href="../../styles/kendo.default.min.css" rel="stylesheet">
<link href="../../styles/kendo.default.mobile.min.css" rel="stylesheet">
<script src="../../js/jquery.min.js"></script>
<script src="../../js/jszip.min.js"></script>
<script src="../../js/kendo.all.min.js"></script>
<script src="../content/shared/js/console.js"></script>
<script>
</script>
</head>
<body>
<a class="offline-button" href="../index.html">Back</a>
<div id="example">
<div id="grid"></div>
<script>
$(document).ready(function () {
$("#grid").kendoGrid({
dataSource: {
type: "odata",
transport: {
read: "https://demos.telerik.com/kendo-ui/service/Northwind.svc/Customers"
},
pageSize: 20
},
height: 550,
groupable: true,
sortable: true,
pageable: {
refresh: true,
pageSizes: true,
buttonCount: 5
},
columns: [{
field: "ContactName",
title: "Contact Name",
media: "(min-width: 450px)"
}, {
field: "ContactTitle",
title: "Contact Title",
width: 250,
media: "(min-width: 850px)"
}, {
field: "CompanyName",
title: "Company Name",
width: 250,
media: "(min-width: 850px)"
}, {
field: "Country",
media: "(min-width: 450px)"
}, {
title: "Items",
template: kendo.template($("#responsive-column-template").html()),
media: "(max-width: 450px)"
}]
});
});
</script>
</div>
<script id="responsive-column-template" type="text/x-kendo-template">
<strong>Contact Name</strong>
<p class="col-template-val">#=data.ContactName#</p>
<strong>Contact Title</strong>
<p class="col-template-val">#=data.ContactTitle#</p>
<strong>Company Name</strong>
<p class="col-template-val">#=data.CompanyName#</p>
<strong>Country</strong>
<p class="col-template-val">#=data.Country#</p>
</script>
<style>
.col-template-val {
margin: 0 0 1em .5em;
}
</style>
</body>
</html>