JSFiddle - React, Tailwind, and code Playground
by valchev
HTML
<script src="http://cdn.kendostatic.com/2012.1.229/js/kendo.all.min.js"></script>
<link rel="stylesheet" href="http://cdn.kendostatic.com/2012.1.229/styles/kendo.common.min.css">
<link rel="stylesheet" href="http://cdn.kendostatic.com/2012.1.229/styles/kendo.default.min.css">
<div id="grid"></div>
JavaScript
var gridData = [
{
"firstDate": new Date(2012, 05, 24),
"secondDate": new Date(2012, 06, 24)
},
{
"firstDate": new Date(2012, 08, 21),
"secondDate": new Date(2012, 09, 12)
},
{
"firstDate": null,
"secondDate": new Date(2012, 06, 30)
},
{
"firstDate": new Date(2012, 04, 01),
"secondDate": new Date(2012, 04, 03)
}
]
$(document).ready(function() {
$("#grid").kendoGrid({
dataSource: {
data: gridData,
schema: {
model: {
fields: {
firstDate: { type: "date" },
secondDate: { type: "date" }
}
}
}
},
toolbar: ["create", "save", "cancel"],
columns: [
{
field: "firstDate",
title: "Start",
template: "#= (firstDate == null) ? ' ' : kendo.toString(firstDate, 'dd MMMM yyyy') #",
editor: firstDateEditor
},
{
field: "secondDate",
title: "End",
template: "#= (secondDate == null) ? ' ' : kendo.toString(secondDate, 'dd MMMM yyyy') #"
}
],
editable: true
});
});
function firstDateEditor(container, options) {
$('<input data-bind="value:' + options.field + '"/>')
.appendTo(container)
.kendoDatePicker()
}