Hi,
I have got a grid like this:
@(Html.EJ().Grid<SlimHub.Models.Site>("SitesGrid")
.Datasource(ds =>ds.Json((IEnumerable<Site>)Model.Sites.ToList()).UpdateURL("../NormalSiteUpdate").InsertURL("../NormalSiteInsert").RemoveURL("../NormalSiteDelete").Adaptor(AdaptorType.RemoteSaveAdaptor))
.EditSettings(edit => { edit.AllowAdding().AllowDeleting().AllowEditing().EditMode(EditMode.InlineFormTemplate).InlineFormTemplateID("#customerInlineFormTemplate"); })
.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)
.DetailsTemplate("#SiteDetailsTemplate")
.Columns(col =>
{
col.Field("SiteId").HeaderText("ID").HeaderTextAlign(TextAlign.Center).IsPrimaryKey(true).TextAlign(TextAlign.Right).Width(0).Visible(false).Add();
col.Field("CustomerId").Width(0).Visible(false).DefaultValue(Model.CustomerId).Add();
col.Field("InsertDate").HeaderText("Data Ins.").TextAlign(TextAlign.Center).DefaultValue(DateTime.Now).EditType(EditingType.DateTimePicker).Format("{0:dd/MM/yyyy}").Visible(false).Width(20).Add();
col.Field("SiteName").HeaderText("Denominazione").Template("#siteNameTemplate").HeaderTextAlign(TextAlign.Center).Width(30).Visible(true).Add();
})
.ClientSideEvents(eve =>
{
eve.ActionComplete("siteComplete");
})
)
The custom editing inline template is defined as below:
<script id="customerInlineFormTemplate" type="text/template">
<div class="Row">
<div class="SubHeaderColumn">Dettagli Sito Operativo</div>
<div class="siteGroup">
<table class="SiteTable" cellpadding="2">
<colgroup>
<col width="10%">
<col width="90%">
</colgroup>
<tbody>
<tr>
<td>Denominazione</td>
<td class="siteData">
<input id="SiteName" name="SiteName" value="{{: SiteName}}" class="e-field e-ejinputtext valid" />
<input type="hidden" id="SiteId" name="SiteId" value="{{: SiteId}}" />
<input type="hidden" id="CustomerId" name="CustomerId" value="{{: CustomerId}}" />
<input id="InsertDate" name="InsertDate" value="{{: InsertDate}}" />
</td>
</tr>
<tr>
<td>Sede Legale</td>
<td class="siteData">
{{if IsLegalSite}} <input type="checkbox" id="IsLegalSite" checked="checked" name="IsLegalSite" class="e-field e-ejinputtext valid" style="text-align: center;" />{{else}} <input type="checkbox" id="IsLegalSite" name="IsLegalSite" class="e-field e-ejinputtext valid" style="text-align: center;" />{{/if}}
</td>
</tr>
<tr>
<td>Sede Operativa</td>
<td class="siteData">
{{if IsOperatingSite}} <input type="checkbox" id="IsOperatingSite" checked="checked" name="IsOperatingSite" class="e-field e-ejinputtext valid" style="text-align: center;" />{{else}} <input type="checkbox" id="IsOperatingSite" name="IsOperatingSite" class="e-field e-ejinputtext valid" style="text-align: center;" />{{/if}}
</td>
</tr>
<tr>
<td>Nazione</td>
<td class="siteData">
<select id="Country" name="Country">
<option value="Albania">Albania</option>
<option value="Andorra">Andorra</option>
<option value="Austria">Austria</option>
<option value="Belgio">Belgio</option>
<option value="Danimarca">Danimarca</option>
<option value="Finlandia">Finlandia</option>
<option value="Francia">Francia</option>
<option value="Germania">Germania</option>
<option value="Gran Bretagna">Gran Bretagna</option>
<option value="Irlanda">Irlanda</option>
<option value="Italia">Italia</option>
<option value="Norvegia">Norvegia</option>
<option value="Polonia">Polonia</option>
<option value="Portogallo">Portogallo</option>
<option value="Spagna">Spagna</option>
<option value="Svezia">Svezia</option>
<option value="Svizzera">Svizzera</option>
</select>
</td>
</tr>
<tr>
<td>Regione</td>
<td class="siteData">
<input id="Region" name="Region" value="{{: Region}}" class="e-field e-ejinputtext valid" style="display: inline-block; text-align: left;" />
</td>
</tr>
<tr>
<td>Provincia</td>
<td class="siteData">
<input id="Province" name="Province" value="{{: Province}}" class="e-field e-ejinputtext valid" style="text-align: left;" />
</td>
</tr>
</tbody>
</table>
</div>
<br />
</div>
</script>
There is a very strange behaviour:
If I add or delete a record from the grid, everything is OK.
When I try to modify a record and then click on the Save button, changes are recognized only if I modify the text of the first field (highlighted).
If I leave that field unchanged, when I save the record, the args.requestType is CANCEL and so the update CRUD method is not called.
I'm using version 15.1.0.41 of Essential Studio and updated the js libraries...
Can you help me?
Thanks