IF-ELSE STATEMENT IN ITEMTPL IN SENCHA TOUCH

Simons Hood

Total Post:70

Points:494
Posted by  Simons Hood
 5134  View(s)
Ratings:
Rate this:
Hi,

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

Any help on above is really appreciated.

  1. Sumit Kesarwani

    Post:378

    Points:2694
    Re: if-else statement in itemTpl in Sencha Touch

    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

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!