@(Html.EJ().Grid<SlimHub.Models.Equipment>("EquipmentGrid")
.Datasource(ds => ds.Json((IEnumerable<object>) ViewBag.dataSource).UpdateURL("NormalUpdate").InsertURL("NormalInsert").RemoveURL("NormalDelete").Adaptor(AdaptorType.RemoteSaveAdaptor))
.EditSettings(edit => { edit.AllowAdding().AllowDeleting().AllowEditing(); })
.Locale("it-IT")
.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);
});
})
.AllowResizing()
.AllowTextWrap(true)
.EnableHeaderHover()
.AllowFiltering()
.FilterSettings(filter => { filter.FilterType(FilterType.Excel); })
.AllowGrouping()
.Columns(col =>
{
col.Field("EquipmentId").HeaderText("ID").HeaderTextAlign(TextAlign.Center).IsPrimaryKey(true).TextAlign(TextAlign.Right).Width(5).Visible(false).Add();
col.Field("EquipmentCode").HeaderText("Codice").HeaderTextAlign(TextAlign.Center).Width(5).Add();
col.Field("EquipmentDesc").HeaderText("Descrizione").HeaderTextAlign(TextAlign.Center).Width(20).Add();
col.Field("EquipmentDetails").HeaderText("Dettagli").HeaderTextAlign(TextAlign.Center).Width(20).Add();
col.Field("UnitPrice").Format("{0:c2}").HeaderText("Prezzo Unitario").HeaderTextAlign(TextAlign.Center).TextAlign(TextAlign.Right).Width(5).Add();
col.Field("EquipmentCategory").HeaderText("Categoria").EditType(EditingType.Dropdown).HeaderTextAlign(TextAlign.Center).Width(10).Add();
col.Field("TechDocFileName").HeaderText("Scheda Tecnica").HeaderTextAlign(TextAlign.Center).Visible(false).Width(10).Add();
col.Field("SecurityDocFileName").HeaderText("Scheda Sicurezza").HeaderTextAlign(TextAlign.Center).Visible(false).Width(10).Add();
col.Field("isAV").HeaderText("AV").HeaderTextAlign(TextAlign.Center).TextAlign(TextAlign.Center).Width(5).EditType(EditingType.Boolean).Add();
col.Field("isDE").HeaderText("DE").HeaderTextAlign(TextAlign.Center).TextAlign(TextAlign.Center).Width(5).EditType(EditingType.Boolean).Add();
col.Field("isDB").HeaderText("DB").HeaderTextAlign(TextAlign.Center).TextAlign(TextAlign.Center).Width(5).EditType(EditingType.Boolean).Add();
col.Field("isDI").HeaderText("DI").HeaderTextAlign(TextAlign.Center).TextAlign(TextAlign.Center).Width(5).EditType(EditingType.Boolean).Add();
col.Field("isDR").HeaderText("DR").HeaderTextAlign(TextAlign.Center).TextAlign(TextAlign.Center).Width(5).EditType(EditingType.Boolean).Add();
col.Field("isDS").HeaderText("DS").HeaderTextAlign(TextAlign.Center).TextAlign(TextAlign.Center).Width(5).EditType(EditingType.Boolean).Add();
col.Field("isFO").HeaderText("FO").HeaderTextAlign(TextAlign.Center).TextAlign(TextAlign.Center).Width(5).EditType(EditingType.Boolean).Add();
col.Field("isMO").HeaderText("MO").HeaderTextAlign(TextAlign.Center).TextAlign(TextAlign.Center).Width(5).EditType(EditingType.Boolean).Add();
col.Field("isVA").HeaderText("VA").HeaderTextAlign(TextAlign.Center).TextAlign(TextAlign.Center).Width(5).EditType(EditingType.Boolean).Add();
col.HeaderText("Scheda Tecnica").AllowFiltering(false).HeaderTextAlign(TextAlign.Center).Template(true).TemplateID("#TechDocColumnTemplate").Width(10).IsUnbound(true).Add();
col.HeaderText("Scheda Sicurezza").AllowFiltering(false).HeaderTextAlign(TextAlign.Center).Template(true).TemplateID("#SecurityDocColumnTemplate").IsUnbound(true).Width(10).Add();
col.HeaderText("Gestione").AllowFiltering(false).Commands(command =>
{
command.Type("Dettagli")
.ButtonOptions(new Syncfusion.JavaScript.Models.ButtonProperties()
{
ContentType = ContentType.ImageOnly,
PrefixIcon = "fa fa-pencil-square-o",
Click = "onDetailsClick"
}).Add();
}).IsUnbound(true).Width(10).Add();
})
.ClientSideEvents(eve => { eve.ActionComplete("complete").ActionBegin("begin").EndEdit("endEdit").EndAdd("endAdd"); })
)
When the grid is loaded, everything is ok.
If I group, for example, the Category column and then I double click on the EquipmentDesc for inline modification, the content of the textbox changes its value assuming one of another row.
If I remove grouping everything is ok.