@(Html.EJ().DataManager("dmPersonNames").URL("/Person/GetPersonNames").Adaptor(AdaptorType.UrlAdaptor)
.ActionComplete("onComplete").RowSelecting("cancelSelectionIfDisabled"); })
function onComplete(args) {
if (args.requestType == "delete") {
location.reload();
}
}
my Question is how to reload/refresh data in the grid from server after delete action.
the delete action does not delete the record under some conditions. so, I need to make sure the reload/refresh data in the grid from server again.
However, location.reload makes page flickering, so I'm looking for better solution.
Thank you very much.
Kind Regards,
@(Html.EJ().Grid<object>("HierarchyGrid")
.Datasource(ds => ds.URL("/Grid/Data").UpdateURL("/Grid/Update").InsertURL("/Grid/Insert").RemoveURL("/Grid/Delete").Adaptor(AdaptorType.UrlAdaptor))
.EditSettings(edit => { edit.AllowAdding().AllowDeleting().AllowEditing(); })
.AllowPaging()
-------------------------
.Columns(col =>
{
--------
})
)
----------------------------------------------------
public ActionResult Update(EditableOrder value)
{
OrderRepository.Update(value);
return Json(value, JsonRequestBehavior.AllowGet);
}
//Insert action
public ActionResult Insert(EditableOrder value)
{
OrderRepository.Add(value);
return Json(value, JsonRequestBehavior.AllowGet);
}
//Delete Action
public ActionResult Delete(int key)
{
OrderRepository.Delete(key);
return Json(key, JsonRequestBehavior.AllowGet);
} |
@(Html.EJ().Grid<object>("HierarchyGrid")
.Datasource(ds => ds.URL("/Grid/Data").UpdateURL("/Grid/Update").InsertURL("/Grid/Insert").RemoveURL("/Grid/Delete").Adaptor(AdaptorType.UrlAdaptor))
.EditSettings(edit => { edit.AllowAdding().AllowDeleting().AllowEditing(); })
.AllowPaging()
-------------------------
.Columns(col =>
{
--------
})
)
----------------------------------------------------
public ActionResult Update(EditableOrder value)
{
OrderRepository.Update(value);
return Json(value, JsonRequestBehavior.AllowGet);
}
//Insert action
public ActionResult Insert(EditableOrder value)
{
OrderRepository.Add(value);
return Json(value, JsonRequestBehavior.AllowGet);
}
//Delete Action
public ActionResult Delete(int key)
{
OrderRepository.Delete(key);
return Json(key, JsonRequestBehavior.AllowGet);
} |