kendo grid custom transport functions
HTML
<script src="http://cdn.kendostatic.com/2012.1.515/js/kendo.all.min.js"></script>
<link rel="stylesheet" href="http://cdn.kendostatic.com/2012.1.322/styles/kendo.common.min.css">
<link rel="stylesheet" href="http://cdn.kendostatic.com/2012.1.322/styles/kendo.default.min.css">
JavaScript
var dsHistory = new kendo.data.DataSource({
transport: {
read: {
//using jsfiddle echo service to simulate JSON endpoint
url: "/echo/json/",
dataType: "json",
type: "POST",
contentType: "application/json; charset=utf-8",
data: {
// /echo/json/ echoes the JSON which you pass as an argument
json: JSON.stringify([
{
[
year: 2011,
month: 12,
work_minutes_to_pay: 809,
hours: 13.483333333333333
[,
]
year: 2011,
month: 12,
work_minutes_to_pay: 809,
hours: 13.483333333333333
],
[
year: 2011,
month: 12,
work_minutes_to_pay: 809,
hours: 13.483333333333333
]
}
])
}
}
},
change: function(response) {
alert("from change event:" + response.sender._data[0].year)
//$("#monthTemplateView").html(kendo.render(monthTemplateScript, this.view()));
},
error: function(response) { // subscribe to the CHANGE event of the data source
alert("dsHistory error DataSource:\n" + response.errorThrown + "\n" + arguments[0].xhr.responseText);
}
});
//Load the history data
dsHistory.read();