I know this does not sound smart but im trying to use KendoUI Jquery grid with MVC and the problem is the parameter of the event create, update is empty
<script type="text/javascript"> $(document).ready(function () { var transport = { read: { contentType: "application/json; charset=utf-8", type: "POST", dataType: "json", url: "JQueryGrid/Grid_Read" }, update: { url: "JQueryGrid/Grid_Update", contentType: "application/json; charset=utf-8", type: "POST" }, create: { url: "JQueryGrid/Grid_Create", type: "POST" }, destroy: { contentType: "application/json; charset=utf-8", url: "JQueryGrid/Grid_Destroy", type: "POST", dataType: "json" }, parameterMap: function (data, operation) { return kendo.stringify(data); } }; var dataSource = new kendo.data.DataSource({ transport: transport, batch: true, pageSize: 30, schema: { model: { id: "PersonalID", fields: { PersonalID: { type: "number", editable: false }, FirstName: { type: "string", validation: { required: true} }, LastName: { type: "string", validation: { required: true} }, DOB: { type: "date" } } } } }); $("#grid").kendoGrid({ dataSource: dataSource, height: 250, filterable: true, type: "odata", sortable: true, pageable: true, editable: "inline", toolbar: ["create"], columns: [ { field: "PersonalID", filterable: false, width: 100 }, { field: "FirstName", title: "First Name", width: 200 }, { field: "LastName", title: "Last Name", width: 200 }, { field: "DOB", title: "Date born", width: 100, format: "{0:MM/dd/yyyy}" }, { command: ["edit", "destroy"], title: " ", width: "210px" } ] }); }); </script>
public ActionResult Grid_Read() { var personalDtos = _personalService.GetAllPersonalByFilters(1, string.Empty); return Json(personalDtos); } [HttpPost] public ActionResult Grid_Update(PersonalDto dto) //<--- comes empty { var personalDtos = _personalService.GetAllPersonalByFilters(1, string.Empty); return Json(personalDtos); } [HttpPost] public ActionResult Grid_Create(PersonalDto dto)//<--- comes empty{ var personalDtos = _personalService.GetAllPersonalByFilters(1, string.Empty); return Json(personalDtos); }