I create simple grid with CRUD operation and update database via CrudURL. When I click add item on toolbar and input data then Save, input value does not send through CrudController.
[Razer]
@(Html.EJ().Grid<Computer>("FlatGrid")
.Datasource(ds => ds.URL(@Url.Action("DataSource", "Inventory")).CrudURL(@Url.Action("CrudUpdate", "Inventory")).Adaptor(AdaptorType.UrlAdaptor))
.AllowPaging()
.AllowSelection()
.EditSettings(edit =>
{
edit
.AllowAdding()
.AllowDeleting()
.AllowEditing()
.EditMode(EditMode.DialogTemplate).DialogEditorTemplateID("#template");
})
.ToolbarSettings(toolbar =>
{
toolbar.ShowToolbar().ToolbarItems(items =>
{
items.AddTool(ToolBarItems.Add);
items.AddTool(ToolBarItems.Edit);
items.AddTool(ToolBarItems.Delete);
items.AddTool(ToolBarItems.Update);
items.AddTool(ToolBarItems.Cancel);
});
})
...
[Controller]
public ActionResult CrudUpdate(Computer computer, string action) <----- property of computer has null value and ID = 0 but I have selected another ID to edit.
{
switch (action)
{
case "insert":
...
Do you have any suggestion about this case or Sample CRUD project that work with database?