or
<script> $(document).ready(function () { var crudServiceBaseUrl = "http://demos.kendoui.com/service", dataSource = new kendo.data.DataSource({ transport: { read: { dataType: "json" },
destroy: { dataType: "jsonp", contentType: "application/json; charset=utf-8" }, parameterMap: function(options, operation) { if (operation !== "read" && options.models) { return {models: kendo.stringify(options.models)}; } } }, batch: true, pageSize: 30, schema: { data: "myList", model: { id: "uuid", fields: { uuid: { editable: false, nullable: true }, lang: { type: "string" }, text: { type: "string" } } } } }); $("#grid").kendoGrid({ dataSource: dataSource, pageable: true, height: 400, toolbar: ["create"], columns: [ { field:"lang", title: "Language" }, { field: "text", title:"Text", width: "150px" }, { command: ["edit", "destroy"], title: " ", width: "210px" }], editable: "popup" }); }); </script>| callback | jQuery17201980517354870166_1353667373995 |
| models | [{"lang":"de","text":"ProjectRoot-System","uuid":"c0437761-1c29-11e2-892e-0800200c9a66"},{"lang":"de","text":"Stephan","uuid":"46baf7b1-2345-11e2-81c1-0800200c9a66"}] |
org.apache.struts2.json.JSONReader.buildInvalidInputException(JSONReader.java:155)
I did a debugging on the JSONInterceptor and found out that the json variable when trying to do the deserialize
Object obj = JSONUtil.deserialize(request.getReader());
the json variable is an empty string. Thus the above error.
Second Scenario
Instead of calling a function to delete, i changed that to call an action. When doing this, the action
is called and my String models variable is set with the following values [{"lang":"de","text":"ProjectRoot-System","uuid":"c0437761-1c29-11e2-892e-0800200c9a66"}].
This seems sort of correct. Unfortunately with this case, the whole process does not go through the
JSONInterceptor, so no deserialization is happening.
So what is my goal:
To be able when pressing on delete to call the delete function and set the object with the values that are
sent from kendo in order to continue with my own business logic process. What could be wrong
in my first scenario ?
Please let me know if you need further information.
Regards
Stephan

public class ContactModel { public int Id { get; set; } public string FirstName { get; set; } public string LastName { get; set; } public string GenderCode { get; set; } public DateTime BirthDate { get; set; } public AddressModel Address { get; set; } public string Email { get; set; } public string Phone { get; set; } public decimal DesiredSalary { get; set; } }[AcceptVerbs(HttpVerbs.Post)] public ActionResult _UpdateGridData([DataSourceRequest] DataSourceRequest request, [Bind(Prefix="models")]IEnumerable<Models.ContactModel> models) { if (models != null && ModelState.IsValid) { foreach (var contact in models) { var target = model.Values.Where(x => x.Id == contact.Id).FirstOrDefault(); if (target != null) { target.LastName = contact.LastName; target.FirstName = contact.FirstName; target.BirthDate = contact.BirthDate; target.GenderCode = contact.GenderCode; } } } return Json(ModelState.ToDataSourceResult()); }// Create a Datasource.var gridDataSource = new kendo.data.DataSource({ dataType: "json", data: "Data", transport: { read: { url: '@Url.Action("_GetGridData", "KendoGrid")', dataType: "json" }, update: { url: '@Url.Action("_UpdateGridData", "KendoGrid")', dataType: "json", type: "POST" } }, pageSize: 10, batch: true, schema: { model: { id: "Id", fields: { Id: { type: "number", editable: false, nullable: true }, FirstName: { type: "string", validation: { required: true } }, LastName: { type: "string", validation: { required: true } }, GenderCode: { type: "string", nullable: true }, BirthDate: { type: "date" } } } }});// Create a Grid using the above data source.$("#inlinekendogrid").kendoGrid({ columns: [ { field: "Id", title: "ID", width: 8, filterable: false, editable: false }, { field: "FirstName", title: "First Name", width: 25 }, { field: "LastName", title: "Last Name", width: 25 }, { field: "GenderCode", title: "Gender", width: 25 }, { field: "BirthDate", title: "Born", width: 25, format: "{0:MM/dd/yyyy}" } ], editable: { create: true, update: true, destroy: true, confirmation: "Are you sure you wish to remove this entry?" }, dataSource: gridDataSource, sortable: { mode: "multiple" }, pageable: { refresh: true, pageSizes: true }, selectable: true, navigatable: true, filterable: true});models[0][Id]:2models[0][FirstName]:Sallymodels[0][LastName]:Shoreman22models[0][GenderCode]:Fmodels[0][BirthDate]:Mon Sep 20 2010 00:00:00 GMT-0700 (Pacific Daylight Time)models[0][Address][AddressLine1]:2 Way Streetmodels[0][Address][AddressLine2]:models[0][Address][AddressLine3]:models[0][Address][City]:Salemmodels[0][Address][State]:ORmodels[0][Address][ZipCode]:97312models[0][Email]:salshor@saif.commodels[0][Phone]:models[0][DesiredSalary]:0