k-grid num box
by valchev
HTML
<script src="http://cdn.kendostatic.com/2012.1.322/js/kendo.all.min.js"></script>
<link rel="stylesheet" href="http://cdn.kendostatic.com/2012.1.322/styles/kendo.common.min.css">
<link rel="stylesheet" href="http://cdn.kendostatic.com/2012.1.322/styles/kendo.metro.min.css">
<div id="example">
<div id="grid"></div>
</div>
CSS
#grid {
width: 60%;
margin: 0 auto;
}
JavaScript
var dataSource = new kendo.data.DataSource({
transport: {
read: {
//using jsfiddle echo service to simulate JSON endpoint
url: "/echo/json/",
dataType: "json",
type: "POST",
data: {
// /echo/json/ echoes the JSON which you pass as an argument
json: JSON.stringify([
{
"Hours": 2,
"MemberId": 62,
"Minutes": 0},
{
"Hours": 0,
"MemberId": 66,
"Minutes": 45}
])
}
}
},
schema: {
model: {
fields: {
MemberId: { type: "number" },
Hours: { type: "number" },
Minutes: { type: "number" }
}
}
}
});
$("#grid").kendoGrid({
dataSource: dataSource,
columns: [
"MemberId",
{ field: "Hours", width: "70px", format: "{0:n0}" },
{ field: "Minutes", width: "70px", format: "{0:n0}" }
],
editable: true
});