CRUD local database with Kendo
HTML
<script src="http://cdn.kendostatic.com/2012.3.1315/js/kendo.all.min.js"></script>
<script src="http://include.jaydata.org/datajs-1.0.3.js"></script>
<script src="http://include.jaydata.org/jaydata.js"></script>
<script src="http://include.jaydata.org/jaydatamodules/kendo.js"></script>
<link rel="stylesheet" href="http://cdn.kendostatic.com/2012.3.1315/styles/kendo.common.min.css">
<link rel="stylesheet" href="http://cdn.kendostatic.com/2012.3.1315/styles/kendo.default.min.css">
<h3>CRUD a local database with Kendo UI Grid</h3>
<p>Uncomment some of the fields in the code to have them appear in the grid. Bevare, changing the schema will erase your database unless you use the Schema Evolutions module.
<p>
<div id="grid"></div>
CSS
body {
font-family: Segoe UI Light
}
JavaScript
$(function() {
var Task = $data.define("Task", {
Todo: String,
Completed: Boolean
//,DueDate: Date
//,Priority: Number
});
$('#grid').kendoGrid({
dataSource: Task.asKendoDataSource(),
filterable: true,
sortable: true,
pageable: true,
editable: 'popup',
toolbar: ['create'],
columns: Task.getFieldNames().concat([{
command: ['destroy', 'edit']
}])
});
});