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

Total Post:70

Posted on    June-14-2013 6:55 AM

 Sencha Touch Sencha Touch 

 1 Reply(s)
 4228  View(s)
Rate this:

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

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>',



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


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

Follow MindStick