JSFiddle - React, Tailwind, and code Playground
by siliconsoul
HTML
<script src="http://cdn.kendostatic.com/2013.1.319/js/kendo.all.min.js"></script>
<link rel="stylesheet" href="http://cdn.kendostatic.com/2013.1.319/styles/kendo.common.min.css">
<link rel="stylesheet" href="http://cdn.kendostatic.com/2013.1.319/styles/kendo.default.min.css">
<div id="grid"></div>
JavaScript
var data = [{
text: "main1",
items: [{
text: "sub1"
}, {
text: "sub2",
}]
},{
text: "main2",
items: [{
text: "sub1"
}, {
text: "sub2",
}]
}];
$("#grid").kendoGrid({
dataSource: {
transport: {
read: {
url: "/echo/json/",
type: "POST",
data: {
json: kendo.stringify(data)
}
}
}
},
detailInit: detailInit,
dataBound: function() {
this.expandRow(this.tbody.find("tr.k-master-row"));
},
columns: [
{
field: "text"
}
]
});
function detailInit(e) {
$("<div/>").appendTo(e.detailCell).kendoGrid({
dataSource: e.data.items,
columns: [
{ field: "text" }
]
});
}