AutoSync Grid
by grippstick
HTML
<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.metro.min.css">
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://cdn.kendostatic.com/2013.1.319/js/kendo.all.min.js"></script>
<div id='container'>
<div data-role='grid' data-bind='source:dsFrequentlyUsedNotes'></div>
</div>
JavaScript
var data = [{
key: 'test',
value: 'sdfsdcgdfhhrfhg'
}, {
key: 'sdf',
value: 'tesadsadst2'
}];
var vm = new kendo.observable({
dsFrequentlyUsedNotes: 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: kendo.stringify(data)
}
}
}
})
});
kendo.bind($('#container'), vm);