Note that there are some explanatory texts on larger screens.

plurals
  1. POKendo grid - Posted Edit is null at Controller
    primarykey
    data
    text
    <p>Using kendo grid with Popup edit. I verified the data is posted from the view (I can see it in the Network Tab, here is a look at it:</p> <pre><code>{"LetterId":12,"BodyText":"This is a test","CreatedDate":"07/31/2013","CreatedBy":"Grace Rodgers","ModifiedDate":"07/31/2013","ModifiedBy":"Grace Rodgers","PersonId":18,"FirstName":"Jason","LastName":"Bigby"}: </code></pre> <p>However, I have a breakpoint at the json method in the controller, and when hovering over the model parameter, in shows all fields are null. Here is the first couple lines of the controller code:</p> <pre><code> [HttpPost] public JsonResult JsonEditLetter(LetterViewModel model) { </code></pre> <p>and the kendo code in the view:</p> <pre><code>var PersId = $("#PersonId").val(); var ds_LettersGrid = new kendo.data.DataSource({ transport: { read: { url: '@Url.Action("JsonGetLetterList", "Letter")/' + PersId, dataType: 'json' }, update: { url: '@Url.Action("JsonEditLetter", "Letter")', dataType: 'json', type: "POST" }, parameterMap: function (data, type) { if (type == "update") { data.models[0].CreatedDate = kendo.toString(new Date(data.models[0].CreatedDate), "MM/dd/yyyy"); data.models[0].ModifiedDate = kendo.toString(new Date(data.models[0].ModifiedDate), "MM/dd/yyyy"); return kendo.stringify(data.models[0]); } }, }, batch: true, schema: { model: { id: "LetterId", fields: { BodyText: { editable: true }, CreatedDate: { editable: false, type: "date"}, ModifiedDate: { editable: false, type: "date" }, CreatedBy: { editable: false}, ModifiedBy: { editable: false }, PersonId: { defaultValue: PersId } } } }, pageSize: 10 }); $(document).ready(function () { $("#letter-list").kendoGrid({ dataSource: ds_LettersGrid, sortable: true, filterable: { extra: false, operators: { string: { startswith: "Starts with", eq: "Is equal to" } } }, pageable: true, columns: [{ field: "BodyText", title: "Letter Content", width: 400, filterable: false }, { field: "CreatedBy", title: "Author", filterable: false }, { field: "CreatedDate", title: "Original Date", format: "{0:g}", filterable: { ui: "datetimepicker" } }, { field: "ModifiedBy", title: "Edited By", filterable: false }, { field: "ModifiedDate", title: "Editted On", format: "{0:g}", filterable: { ui: "datetimepicker" } }, { command: [ "edit" ], title: "", width: "110px" }], height: "300px", resizable: true, editable: "popup" }); }); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload