Template not e

When I have a template as a column it does seem to update the {{: items

@Html.EJS().Grid("FieldList").AllowSorting(true).AllowPaging(true).DataSource(dataManger =>
{ dataManger.Url("/TimeAndExpense/Field/UrlDatasource").Adaptor("UrlAdaptor"); }).Columns(col =>
{
    col.Field("Id").HeaderText("Id").IsPrimaryKey(true).Width("40").ValidationRules(new { required = true }).TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Visible(true).Add();
    col.Field("Week").HeaderText("Week").Width("40").ValidationRules(new { required = true }).TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Visible(true).Format("yMd").Add();
    col.Field("JobDescription").HeaderText("Job").Width("40").ValidationRules(new { required = true }).TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Visible(true).Add();
    col.HeaderText("Manage Records").Template("<a rel='nofollow' rel='nofollow' href='Edit/?Id={{:Id}}'>/Edit/{{:Id}}</a>").Add();
}).Load("loadFieldList").RowSelected("onRowSelected").Render()

Results in the following


3 Replies

PS Pavithra Subramaniyam Syncfusion Team April 17, 2019 05:56 AM UTC

Hi Dave, 

Thanks for contacting Syncfusion support. 

In Essential JavaScript 2, we suggest you to use template literals (“${}”) for templates. Please refer to the code example, documentation link  for more information. 

[index.cshtml] 
col.HeaderText("Manage Records").Template("<a rel='nofollow' rel='nofollow' href='Edit/?Id=${OrderID}'>/Edit/${OrderID}</a>").Add(); 


Please contact us if you need any further assistance on this. 
 
Regards, 
Pavithra S. 
 



DN Dave Nixon April 17, 2019 01:25 PM UTC

Thanks I must of been looking at the wrong samples.


PS Pavithra Subramaniyam Syncfusion Team April 18, 2019 06:56 AM UTC

Hi Dave, 
 
Thanks for your update. 
 
Please get back to us if you need further assistance. 
 
Regards, 
Pavithra S. 
 


Loader.
Up arrow icon