We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Unable to get the column value rendered in the actionlink

Hi,

I am unable to get the Category value rendered in the actionlink.

Here is how I am attempting it:
<div id="ControlRegion" style="max-width: 898px;">
    @Html.EJS().Grid("FlatGrid2").Width(805).GridLines(Syncfusion.EJ2.Grids.GridLine.Both).DataSource(ds => ds.Url(@Url.Action("UrlDatasource2", "Budget")).Adaptor("UrlAdaptor")).AllowSorting().AllowFiltering().AllowResizing(true).Columns(col =>
{
    col.Field("Category").HeaderText("Category").HeaderTextAlign(Syncfusion.EJ2.Grids.TextAlign.Center).Template("#customSubCatLink").Add();
    col.Field("Status").AllowFiltering(false).AllowSorting(false).HeaderText("Status").Format("N2").Template("#progessTemplate").Add();
}).SelectionSettings(select => select.Type(Syncfusion.EJ2.Grids.SelectionType.Multiple)).QueryCellInfo("queryCellInfo").PageSettings(page => page.PageCount(2)).EditSettings(edit => { edit.AllowAdding(false).AllowEditing(false).AllowDeleting(false).Mode(Syncfusion.EJ2.Grids.EditMode.Dialog).ShowDeleteConfirmDialog(true); }).SortSettings(sort => sort.Columns(cols2)).FilterSettings(filter => { filter.Type(Syncfusion.EJ2.Grids.FilterType.Menu); }).Toolbar(new List<string>() { "Search" }).Render()
</div>

<script type="text/x-jsrender" id="customSubCatLink">
    @Html.ActionLink("${Category}", "Index", "SubcategoryBudget", new { subCatName = "${Category}" }, null)
</script>

And here it what gets rendered:
SubcategoryBudget?subCatName=%24%7BCategory%7D

Thanks,
S

3 Replies

MS Madhu Sudhanan P Syncfusion Team January 3, 2019 06:38 AM UTC

Hi Rohit, 

Thanks for contacting Syncfusion support. 

Essential JS 2 components uses ES6 template engine and hence we cannot use Html helpers inside the column template as most of the time the placeholder values will be escaped/encoded by the html helpers. Hence to use action link inside the cell, please use hyper link as follows. 


<script type="text/x-jsrender" id="customSubCatLink"> 
    <a rel='nofollow' href='/SubcategoryBudget/Index/?subCatName=${Category}'>${Category}</a> 
</script> 


Regards, 
Madhu Sudhanan P 



RS Rohit Shinde January 3, 2019 02:28 PM UTC

Hi Madhu,

Thank you so much for responding to my message. I have to say - Syncfusion's support is one of the best & promptest I have ever seen. You guys are one of the very best out there.

The solution you provided worked well for me. Thank you !! By any chance, do you happen to know if Syncfusion has a specification/documentation for ES6? IF so, can you please provide a link here.

Thanks a lot once again.

-Rohit


MS Madhu Sudhanan P Syncfusion Team January 4, 2019 06:33 AM UTC

Hi Rohit, 

Thanks for the update. 

As we have upgraded our documentation server, the ES6 documentation for the latest release is not available yet. For now you can refer to the below link which refers to the Volume 3, 2018 release. 


You can switch between TypeScript and ES6 using the dropdown list from the top right corner. 

Regards, 
Madhu Sudhanan P 


Loader.
Live Chat Icon For mobile
Up arrow icon