I have editable datagrid. I would like to change read transport to POST and add some additional data to json request (for example access_token).
Example below produce GET request instead of the POST and without additional data.
Question is: How can i do that?
dataSource = new kendo.data.DataSource({
transport: {
read: {
type: "POST",
url: crudServiceBaseUrl + "/Products",
contentType: "application/json; charset=utf-8",
dataType: "jsonp",
data: { "my_param": 1}
},
update: {
type: "PUT",
url: crudServiceBaseUrl + "/Products/Update",
dataType: "jsonp",
data: { "my_param": 1}
},
destroy: {
type: "DELETE",
url: crudServiceBaseUrl + "/Products/Destroy",
dataType: "jsonp",
data: { "my_param": 1}
},
create: {
url: crudServiceBaseUrl + "/Products/Create",
dataType: "json",
type: "PUT",
data: { "my_param": 1}
},
parameterMap: function(options, operation) {
console.log(options);
console.log(operation);
return {data: kendo.stringify(options.models)};
}
},