grid - grouping
HTML
<link rel="stylesheet" href="http://cdn.kendostatic.com/2012.2.621/styles/kendo.common.min.css">
<link rel="stylesheet" href="http://cdn.kendostatic.com/2012.2.621/styles/kendo.default.min.css">
<script src="http://cdn.kendostatic.com/2012.2.621/js/kendo.all.min.js"></script>
<div id="grid"></div>
JavaScript
var dataSource = new kendo.data.DataSource({
data: [
{ team: "", score: 87, date: "01/13/2012" },
{ team: "BOS", score: 89, date: "02/11/2012" },
{ team: "BOS", score: 93, date: "03/15/2012" },
{ team: "LAL", score: 77, date: "01/11/2012" },
{ team: "LAC", score: 100, date: "01/19/2012" },
{ team: "LAL", score: 111, date: "03/17/2012" },
{ team: "LAC", score: 99, date: "04/22/2012" },
{ team: "OKC", score: 92, date: "05/13/2012" },
{ team: "OKC", score: 89, date: "05/10/2012" },
{ team: "LAL", score: 82, date: "09/19/2012" }
],
group: { field: "team" },
sort: { field: "date", dir: "desc" },
schema: {
model: {
fields: {
team:function(item){console.log(item)},
score: {type: "number"},
date: {type: "date"}
}
}
}
});
$(document).ready(function() {
$("#grid").kendoGrid({
dataSource: dataSource,
columns: ["team", "score", { field: "date", format: "{0:MM/dd/yyyy}" }]
});
});