Hello
we are using the latest version of MVC Components. We have a page with the following code
@(Html.EJ().Grid<LessonGroupOutput>("GroupLessonsGrid")
.Locale("el-GR")
.Datasource(ds => ds.Json((IEnumerable<object>)Model)
.InsertURL("LessonGroups/Create")
.UpdateURL("LessonGroups/Update")
.RemoveURL("LessonGroups/Delete")
.Adaptor(AdaptorType.RemoteSaveAdaptor))
.EditSettings(edit => { edit.AllowAdding().AllowDeleting().AllowEditing().EditMode(EditMode.Dialog); })
.ToolbarSettings(toolBar => toolBar.ShowToolbar().ToolbarItems(items =>
{
items.AddTool(ToolBarItems.Add);
items.AddTool(ToolBarItems.Edit);
items.AddTool(ToolBarItems.Delete);
}))
.AllowPaging()
.PageSettings(page => page.PageSize(20))
.AllowSorting()
.Columns(col =>
{
col.Field("Id").HeaderText("Κωδικός").IsPrimaryKey(true).TextAlign(TextAlign.Left)
.ValidationRules(v => v.AddRule("required", true).AddRule("number", true))
.Width(20).Add();
col.Field("Name").HeaderText("Όνομα").Width(180).Add();
})
.ClientSideEvents(events => { events.ActionFailure("OnActionFailure"); })
)
<script>
function OnActionFailure(args) {
alert(args.error.status + ':' + args.error.statusText, 'error');
}
</script>
When we create a new object, the dialog form appears, we set the data and send them through the ajax call to the server.When the server responds with an error (throws dbexception for example) the triggered alert shows the error but when we close the alert dialog the page still shows the insert dialog form with the circular waiting popup. Is there a way to cancel the insert dialog form and get back to the grid?
Thanks