I have a Kendo Grid set up as follows. The url is for the code snippet below, which is an ASP.NET Web Api. When I use "Add new record" on the grid and the press Update, the Post method is called as expected, and the musics parameter exists as expected, however, it is empty. The stringify method has nothing to stringify, in other words. Why is the binding not happening?
dataSource = new kendo.data.DataSource({
transport: {
...
create: {
url: "/api/mywebapi/",
type: "POST"
},
parameterMap: function (data, operation) {
if (operation !== "read" && data.models) {
return { models: kendo.stringify(data.models) };
}
return { models: kendo.stringify(data) };
}
...
The Web Api method:
public HttpResponseMessage Post(IEnumerable<MusicVM> musics)
{
...
}
I should say that in debug I can see that operation is "create" and that data.models does indeed have the new item I entered in the grid.