Now I am learning to developing a web app with kendoui, when I try to udpate the grid data with cusomized popup kendoWindow instead of the kendo built-in edit window, I didn't know how to send the request to the remote serve, so i try to find the answer in official api docs in this page, but there is a new problem occured, show as the follow code:
<script>
var dataSource = new kendo.data.DataSource({
transport: {
read : function (options) {
/* implementation omitted for brevity */
},
update: function (options) {
// make JSONP request to http://demos.kendoui.com/service/products/update
$.ajax({
url : "http://demos.kendoui.com/service/products/update",
dataType: "jsonp", // "jsonp" is required for cross-domain requests; use "json" for same-domain requests
// send the updated data items as the "models" service parameter encoded in JSON
data : {
models: kendo.stringify(options.data.models)
},
success : function (result) {
// notify the data source that the request succeeded
options.success(result);
},
error : function (result) {
// notify the data source that the request failed
options.error(result);
}
});
}
},
batch : true,
schema : {
model: { id: "ProductID" }
}
});
dataSource.fetch(function () {
var product = dataSource.at(0);
product.set("UnitPrice", 20);
dataSource.sync(); makes request to http://demos.kendoui.com/service/products/update
});
</script>
it's a example for illustrate how to specify update as a function to make a HTTP request to the remote service
my problem is what is the parameter 'options' is that passed to read and update function. the only clue I've found is the parameters for transport.parametermap function, but I am not sure there are certain relationship between them, so hope someone some explain for me