Hi, I am trying to get it to work with the controller generated by visual studio for ODATA V3 and EF. The grid initially renders well and shows all data.
This is the code for Put. After a successful Put my record gets updated and code 204 is returned as far as I know. But no data is returned and the grid is not updated to the change. How can I get the grid updated after the put? A page reload shows the correct grid.
Controller:
// PUT: odata/TodoItems(5)
public IHttpActionResult Put([FromODataUri] string key, Delta patch)
{
Validate(patch.GetEntity());
TodoItem todoItem = db.TodoItems.Find(key);
if (todoItem == null)
{
return NotFound();
}
patch.TrySetPropertyValue("CreatedAt", todoItem.CreatedAt);
patch.Put(todoItem);
db.SaveChanges();
return Updated(todoItem);
}
Grid:
@Html.EJS().Grid("OData").DataSource(dataManger =>
{
dataManger.Url("/odata/TodoItems").CrossDomain(true).Adaptor("ODataAdaptor");
})....