Home > DeveloperSection > Forums > if-else statement in itemTpl in Sencha Touch
Simons Hood
Simons Hood

Total Post:70

Points:494
Posted on    June-14-2013 6:55 AM

 Sencha Touch Sencha Touch 
Ratings:


 1 Reply(s)
 4381  View(s)
Rate this:
Hi,

How to write if-else statement in itemTpl configuration of list in Sencha Touch.

Any help on above is really appreciated.



Sumit Kesarwani

Total Post:378

Points:2694
Posted on    June-25-2013 1:27 AM

Hi Samuel,

You can write the if-else condition in itemTpl configuration of list using <tpl> tag like this:

 itemTpl: [

            '<tpl if="boolean == \'true\'">',

            '    <p>{name}</p>',

            '    <tpl else>',

            '                   <p>Boolean is false</p>',

            '</tpl>'

        ]


If you want to learn more about itemTpl configuration , then you can read my article:

If- else statement in itemTpl configuration


Modified On Oct-28-2016 04:54:23 AM

Don't want to miss updates? Please click the below button!

Follow MindStick