Files
upo-senior-assistant/SeniorAssistant/Views/Home/Index.cshtml
Giacomo c807c474c4 Init
- aggiunto un po di tutto comeil progetto del prof
2018-09-14 19:38:02 +02:00

52 lines
1.5 KiB
Plaintext

@model IEnumerable<User>
@{
ViewBag.Title = "Hello Razor";
}
<div id="grid"></div>
<script>
$(document).ready(function () {
var baseUrl = "@Url.Content("~/api/user/")";
$("#grid").kendoGrid({
dataSource: {
transport: {
read: { url: baseUrl, type: "GET" }
/*
parameterMap: function (model, operation) {
if (operation !== "read" && model) {
return kendo.stringify(model);
}
}
*/
},
serverPaging: false,
serverSorting: false,
batch: false,
schema: {
model: {
id: "username",
fields: {
username: { type: "string" },
name: { type: "string" }
}
}
}
},
scrollable: true,
sortable: true,
filterable: true,
editable: false,
columns: [
{ field: "username", title: "Username" },
{ field: "name", title: "Name" } /*,
{ field: "time", title: "Date/Time", format: "{dd/MM/yyyy HH}" },
{ field: "value", title: "Heartbeats" }
*/
]
});
})
</script>