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

No logical operators in JS templates?

Thread ID:

Created:

Updated:

Platform:

Replies:

144650 May 15,2019 05:52 PM UTC May 20,2019 11:05 AM UTC JavaScript - EJ 2 3
loading
Tags: General
derekb
Asked On May 15, 2019 05:52 PM UTC

Hello,

I did not see any logical operators such as && and || in the JS template documentation: https://ej2.syncfusion.com/documentation/common/template-engine/. When I try to use them in a template, the template fails to parse. How do I create conditionals with OR / AND statements? For example, ${if(Value===3 && OtherValue < 5)}.

Thanks,
Derek B

Jesus Arockia Sankaran S [Syncfusion]
Replied On May 16, 2019 11:50 AM UTC

Hi Derek, 
 
Thanks for contacting Syncfusion support.  
 
We have checked the reported issue  but we are not able to reproduce it in our end. However, we have created a sample with logical operators in template engine, and we will include the information about the logical operator in our documentation.  
 
 
Please get back to us if you require any further assistance on this.  
 
Regards,  
Jesus Arockia Sankaran S 
 


derekb
Replied On May 16, 2019 05:54 PM UTC

Hi Jesus,

I'm specifying the template in a Razor page, like this:


 
I tried this as well, to make sure it wasn't an issue with the second grid field:

${if(GridColumn1 === 1 && 1===1)} ...

The template fails to render in the grid. All I see is "#templateId" where the template is supposed to appear. The template renders correctly if I remove the second part of the conditional (1 === 1).

Thanks,
Derek B

Jesus Arockia Sankaran S [Syncfusion]
Replied On May 20, 2019 11:05 AM UTC

Hi Derek,  
 
We have checked the reported logical template issue in ASP.NET Core Razor page, and we are not able to replicate in our end. We have attached the download link of the sample for your reference.  
 
 
Please get back to us if you require any further assistance on this.  
 
Regards,  
Jesus Arockia Sankaran S 
 


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