BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
public ActionResult Update([FromBody]CRUDModel<Project> myObject)
{
var updateData = myObject.Value;
. ..
. . .
return Json(myObject.Value);
} |
public ActionResult CellEditInsertDetail([FromBody]CRUDModel<AlarmModel> value)
{
int readonlyID = int.Parse(Request.Headers["ID"]);
return Json(value.Value);
}
$("#Grid").ejGrid({
dataSource: ej.DataManager({
url: "/Home/DataSource",
updateUrl: "/Home/Update",
adaptor: new ej.UrlAdaptor()
}),
actionBegin: function (args) {
if (args.requestType == "save")
this.model.dataSource.dataSource.headers = [{ ID: args.rowData.OrderID }];
},
. ..
}); |
Hi, thanks It works. Just one thing. For now I am not using headers for ID, but I get Id from:
[FromBody]CRUDModel<Project> myObject
with:
Guid ID = Guid.Parse(myObject.Key.ToString());
, because The ID is there when I check in the console:
, but when I try to get it like this:
int readonlyID = int.Parse(Request.Headers["ID"]);
it is null.
Other thing is for the insert I am using same param:
public IActionResult Create([FromBody]CRUDModel
, but data is null. I see from the console it is send to the server.
public ActionResult CellEditInsertDetail([FromBody]CRUDModel<AlarmModel> value) { int readonlyID = int.Parse(Request.Headers["ID"]); return Json(value.Value); } $("#Grid").ejGrid({ dataSource: ej.DataManager({ url: "/Home/DataSource", updateUrl: "/Home/Update", adaptor: new ej.UrlAdaptor() }), actionBegin: function (args) { if (args.requestType == "save") this.model.dataSource.dataSource.headers = [{ ID: args.rowData.OrderID }]; }, . .. }); |
public ActionResult Insert([FromBody]CRUDModel<Project> myObject) { return Json(myObject.Value); } |
Hi, thx, Query 1 is fixed.
About Query 2, yes I set the model name here [FromBody]CRUDModel<ModelName> myObject.
, but myObject is still null. What I do is exact: [FromBody]CRUDModel<Object> data, Object, but not Model name and now everything works.