Files
Giacomo Bertolazzi b7460cfd78 Refactoring
* refactoring
* fixes
* messages
* new interface
2019-01-18 23:22:03 +01:00

57 lines
1.5 KiB
Plaintext

@model string
@inject IHttpContextAccessor Http
@{
ViewBag.Title = "Hello Razor";
var session = Http.HttpContext.Session.GetString("username");
}
<div id="grid"></div>
<script>
$(document).ready(function () {
var baseUrl = "@Url.Content("~/api/" + Model + "/" + session + "/today")";
$("#grid").kendoGrid({
dataSource: {
transport: {
read: {
url: baseUrl,
type: "GET"
}
},
serverPaging: false,
serverSorting: false,
batch: false,
schema: {
model: {
id: "username",
fields: {
username: { type: "string" },
time: { type: "date" },
value: { type: "number" }
}
}
}
},
scrollable: true,
sortable: true,
filterable: true,
editable: false,
columns: [
{
field: "username",
title: "Username"
},
{
field: "time",
title: "Date/Time",
format: "{0:dd/MM/yyyy HH:mm}"
},
{
field: "value",
title: "@Model"
}
]
});
});
</script>