@{Html.EJ().Grid<object>("HierarchyGrid") .Datasource(datasource => datasource.Json((IEnumerable<object>)ViewBag.datasource).UpdateURL("/Home/Update") .InsertURL("/Home/Insert").RemoveURL("/Home/Remove").Adaptor(AdaptorType.RemoteSaveAdaptor)) .AllowPaging() .AllowRowDragAndDrop() .EditSettings(edit => { edit.AllowAdding(true).AllowDeleting(true).AllowEditing(true).EditMode(EditMode.Normal); }) .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); }); }) .Columns(col => { col.Field("Article").HeaderText("Article").IsPrimaryKey(true).EditType(EditingType.StringEdit).Add(); col.Field("Price").HeaderText("Price").EditType(EditingType.StringEdit).Add(); }).Render();}
The Grid is filled with data correctly, but when I click on the "Add" symbol of the Toolbar, nothing happens. When I click on Edit or Delete without selected any item, a dialog is shown as usual. But when an item is selected, nothing happens too, just like double clicking.
My achievement is to change cell values, make them persistent in the database. Therefore I got the following methods inside my controller.
public ActionResult Update(Order value) { _context.Update(value); var data = _context.Orders; return Json(data); } public ActionResult Insert(Order value) { _context.Add(value); var data = _context.Orders; return Json(data); } public ActionResult Remove(int key) { _context.Remove(null); var data = _context.Orders; return Json(data); }
Could you please help me? When I remember correct, the exact same structure worked in another project I saw the past day.
Please tell me if you need additional information. I've setup the environment (bower, nuget, etc) as stated in the installation guide.
I appreciate help, thanks in advance.
|
.Datasource(datasource => datasource.Json((IEnumerable<object>)ViewBag.datasource).UpdateURL("/Home/Update")
.InsertURL("/Home/Insert").RemoveURL("/Home/Remove").Adaptor(AdaptorType.RemoteSaveAdaptor)) |
|
|