if-else statement in itemTpl in Sencha Touch

Total Post:70

Points:494

 5938  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. 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 Mar-30-2018 04:36:17 AM

Answer

Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.