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

No logical operators in JS templates?

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

3 Replies

JA Jesus Arockia Sankaran S Syncfusion Team 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 
 



DE derekb 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


JA Jesus Arockia Sankaran S Syncfusion Team 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 
 


Loader.
Live Chat Icon For mobile
Up arrow icon