Greetings. I have the following grid, very simple:
@(Html.EJ().Grid<object>("Grid")
.Datasource(ds => ds.Json((IEnumerable<object>)ViewBag.dataSource)
.UpdateURL("AnagraficaFamiglieComponenti/PerformUpdate")
.InsertURL("AnagraficaFamiglieComponenti/PerformInsert")
.RemoveURL("AnagraficaFamiglieComponenti/PerformDelete")
.Adaptor(AdaptorType.RemoteSaveAdaptor))
.Locale("it-IT")
.AllowTextWrap()
.EditSettings(edit => edit.AllowEditing().AllowAdding().EditMode(EditMode.Dialog))
.ToolbarSettings(tools => tools.ShowToolbar().ToolbarItems(items =>
{
items.AddTool(ToolBarItems.Add);
items.AddTool(ToolBarItems.Edit);
items.AddTool(ToolBarItems.Update);
items.AddTool(ToolBarItems.Cancel);
}))
.Columns(col =>
{
//LA PRIMARY KEY VA SEMPRE DEFINITA, EVENTUALMENTE NASCOSTA, SENNO' LE OPERAZIONI CRUD NON FUNZIONANO
col.Field("Id").HeaderText("Id").IsPrimaryKey(true).Visible(false).Add();
col.Field("Nome").HeaderText("Nome")
.ValidationRules(v => v.AddRule("required", true))
.ValidationRules(v => v.AddRule("rangelength", "[3,50]")).Add();
col.Field("Abilitato").HeaderText("Abilitato").DefaultValue(true).EditType(EditingType.Boolean).Add();
})
)
The problem I'm facing is the following: when the user tries to add/edit items, the overlay window opens (since the edit mode is of type "Dialog") and the first input field, correctly, has proper keyboard focus. After about 0.5 seconds, the focus is lost; so the user has to manually click on the first input field. I want to underline that this isn't happening only with this grid, but with every grid in my project which makes use of embedded add/edit through Editmode.Dialog. I just pasted here the simplest grid where this problem is occurring. Thanks in advance for the kind help.