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

conditionnal templating

Thread ID:

Created:

Updated:

Platform:

Replies:

144100 Apr 18,2019 12:30 PM UTC Apr 22,2019 10:48 AM UTC JavaScript - EJ 2 1
loading
Tags: General
emmanuel simon
Asked On April 18, 2019 12:30 PM UTC

Hi,

I try to make a template with condition into a treeview but it does'nt work.

I have au json file like this : 

    [{"id":1,"project_id":1,"nodable_id":null,"nodable_type":null,"node_infos_id":1,"_lft":1,"_rgt":8,"parent_id":null,"deleted_at":null,"created_at":"2019-04-18 08:59:50","updated_at":"2019-04-18 09:17:49","reference":"racine","libelle":"racine","children":[{"id":2,"project_id":1,"nodable_id":null,"nodable_type":null,"node_infos_id":2,"_lft":2,"_rgt":5,"parent_id":1,"deleted_at":null,"created_at":"2019-04-18 09:00:14","updated_at":"2019-04-18 09:17:49","reference":"niveau 1","libelle":"niveau 1","children":[{"id":4,"project_id":1,"nodable_id":15,"nodable_type":"Simfred\\Models\\Tag","node_infos_id":4,"_lft":3,"_rgt":4,"parent_id":2,"deleted_at":null,"created_at":"2019-04-18 09:01:06","updated_at":"2019-04-18 09:17:49","reference":"tag 1","libelle":"tag 1","children":[]}]},{"id":3,"project_id":1,"nodable_id":null,"nodable_type":null,"node_infos_id":3,"_lft":6,"_rgt":7,"parent_id":1,"deleted_at":null,"created_at":"2019-04-18 09:00:34","updated_at":"2019-04-18 09:17:49","reference":"niveau 1b","libelle":"1b","children":[]}]},{"id":5,"project_id":1,"nodable_id":null,"nodable_type":null,"node_infos_id":5,"_lft":9,"_rgt":10,"parent_id":null,"deleted_at":null,"created_at":"2019-04-18 09:01:32","updated_at":"2019-04-18 09:01:32","reference":"racine 2","libelle":"racine 2","children":[]},{"id":6,"project_id":1,"nodable_id":256,"nodable_type":"Simfred\\Models\\Tag","node_infos_id":6,"_lft":11,"_rgt":12,"parent_id":null,"deleted_at":null,"created_at":"2019-04-18 11:18:12","updated_at":"2019-04-18 11:18:12","reference":"ggg","libelle":"ggg","children":[]}]
Into the template I would like to make a contition to nodable_type I wrote this code :
<script id="treeTemplate" type="text/x-template">
<div>
${if(nodable_type=='Simonfred\Models\Tag')}
<span>tag</span>
${else}
<span>rep</span>
${/if}
<div class="">${libelle}-${reference}</div>
</div>
</script>
I missed something ?

Thanks 


Kumaresan Subramani [Syncfusion]
Replied On April 22, 2019 10:48 AM UTC

HI Emmanuel Simon, 
 
We can able to reproduce your reported issue. We need to validate this in some other cases. We will update you with in one business day. 
 
Please let us know if you have any concern. 
 
Regards, 
Kumaresan 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