Hello,
I am moving to Essential JS 2, but I have an issue with Column Template in Grid control,
in the cell of a templated column I can only see the template id, as in the image:
(Last column has template)
Here is the code for the Grid:
@(Html.EJS().Grid<AffidoItem>("Grid").DataSource((IEnumerable<AffidoItem>)ViewBag.Affidi).AllowSorting().AllowMultiSorting().AllowSelection(false).GridLines(GridLine.Both)
.Columns(col =>
{
string width = (100).ToString("P");
col.Field("NUMERO_AFFIDAMENTO").HeaderText("N. Affidamento").TextAlign(TextAlign.Left).Width(width).Add();
col.Field("DATA_AFFIDO_ESA").HeaderText("Affido").TextAlign(TextAlign.Left).Format("yMd").Width(width).Add();
col.Field("DATA_SCAD_ESA").HeaderText("Scadenza").TextAlign(TextAlign.Left).Format("yMd").Width(width).Add();
col.Field("DATA_PROROGA_ESA").HeaderText("Proroga").TextAlign(TextAlign.Left).Format("yMd").Width(width).Add();
col.Field("NUMERO_PRATICHE").HeaderText("N. Pratiche").TextAlign(TextAlign.Right).Width(width).Add();
col.Field("CAPITALE_SCADUTO").HeaderText("Capitale").TextAlign(TextAlign.Right).Format("C2").Width(width).Add();
col.Field("TOTALE_SCADUTO").HeaderText("Totale").TextAlign(TextAlign.Right).Format("C2").Width(width).Add();
col.HeaderText("Azioni").Template("#template").TextAlign(TextAlign.Center).Width(100).Add();
}).Render()
)
The template code:
<script id="template" type="text/x-template">
<p>${:NUMERO_AFFIDAMENTO}</p>
</script>
Thank You,
Fabrizio