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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

text/x-jsrender not working

Thread ID:

Created:

Updated:

Platform:

Replies:

141366 Dec 7,2018 11:37 AM UTC Dec 7,2018 12:23 PM UTC ASP.NET MVC - EJ 2 3
loading
Tags: Grid
Gin
Asked On December 7, 2018 11:37 AM UTC

Please take a look
@(Html.EJS().Grid("Grid").DataSource(ds => ds.Url(@Url.Action("KycDatasource", "Admin")).Adaptor("UrlAdaptor")).AllowSorting().Columns(col =>
                        {                                                                                                                    col.Field("Status").HeaderText("Status").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Center).Template("#statusTemplate").Width("80").Add();
                            col.HeaderText("Action").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Center).Template("#template").Width("150").Add();
                        }).Render())
Then my jsrender is:
<script id="template" type="text/x-jsrender">
    {{if Status == "Pending"}}
    <a class="badge badge-danger" rel='nofollow' href="/Admin/AcceptKyc/${NumberId}">Accept</a>
    {{/if}}
</script>
Result:


What did I do wrong?



Madhu Sudhanan P [Syncfusion]
Replied On December 7, 2018 12:03 PM UTC

Hi Nguyen, 

Thanks for contacting Syncfusion support. 

Essential JS 2 ASP.NET MVC controls uses ES6 like template syntax which is compiled and executed using Essential JS 2 Template engine.  



Now your will look like below to work properly. 


<script id="template" type="text/x-template"> 
    ${if(Status == "Pending")} 
    <a class="badge badge-danger" rel='nofollow' href="/Admin/AcceptKyc/${NumberId}">Accept</a> 
    ${/if} 
</script> 


Regards, 
Madhu Sudhanan P 


Gin
Replied On December 7, 2018 12:11 PM UTC

It's worked.

Thank so much.

Happy coding with Syncfusion :)

Madhu Sudhanan P [Syncfusion]
Replied On December 7, 2018 12:23 PM UTC

Hi Nguyen, 

Thanks for the update. Please get back to us if you require any assistance. 

Regards, 
Madhu Sudhanan P 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon