title: Sencha touch - Ext.XTemplate if/else not working
body: <p>Hi I am new to Sencha touch. I have problem displaying data in <code>Ext.dataview.List</code> with <code>itemTpl</code>. This how I am setting <code>itemTpl</code> in <code>config</code></p>
  
  <pre><code>itemTpl: new Ext.XTemplate(
  
              '&lt;div class="featureImageHolder"&gt;&lt;img class="featureImage" src="{itemImage}" alt="{itemName}" /&gt;&lt;/div&gt;',
  
              '&lt;span class="item"&gt;',
                  '&lt;h3 class="saleName"&gt;{itemName}&lt;/h3&gt;',
                  '&lt;span class="priceOptions"&gt;',
                  '&lt;tpl for="prices"&gt;',
                      '&lt;span class="priceOptionReg"&gt;',
                          '&lt;tpl if="priceOptionDesc"&gt;{priceOptionDesc}&lt;/tpl&gt; ',
                          '&lt;tpl if="priceOptionReg"&gt;{priceOptionReg}&lt;/tpl&gt;  ',
                          '&lt;tpl if="priceReg"&gt;${priceReg}&lt;/tpl&gt;  ',
                          '&lt;tpl if="priceRegSuffix"&gt;{priceRegSuffix}&lt;/tpl&gt; ',
                      '&lt;/span&gt;',
                      '&lt;tpl if="priceSale"&gt;&lt;span class="priceOptionSale"&gt;',
                          '&lt;tpl if="priceSaleDesc"&gt;{priceSaleDesc}&lt;/tpl&gt; ',
                          '&lt;tpl if="priceOptionSale"&gt;{priceOptionSale}&lt;/tpl&gt;  ',
                          '&lt;tpl if="priceSale"&gt;${priceSale}&lt;/tpl&gt;',
                          '&lt;tpl if="priceSaleSuffix"&gt;{priceSaleSuffix}&lt;/tpl&gt; ',
                      '&lt;/span&gt;&lt;/tpl&gt;',
                  '&lt;/tpl&gt;',
                  '&lt;/span&gt;',
              '&lt;/span&gt;',
              '&lt;div class="clear"&gt;&lt;/div&gt;'
          ),
  </code></pre>
  
  <p>It is working perfectly and displaying list of products. But now I need change CSS class for first record only because it is an Ad banner. So I am using following if statement:</p>
  
  <pre><code>itemTpl: new Ext.XTemplate(
                  '&lt;tpl if={isBanner} === true&gt;',
                      '&lt;div class="myTestClass"&gt;{itemImage}&lt;/div&gt;',
  
                  '&lt;tpl elseif={isBanner} === false&gt;',
                      '&lt;div class="featureImageHolder"&gt;&lt;img class="featureImage" src="{itemImage}" alt="{itemName}" /&gt;&lt;/div&gt;',
                  '&lt;/tpl&gt;',
  
  
                  '&lt;span class="item"&gt;',
                      '&lt;h3 class="saleName"&gt;{itemName}&lt;/h3&gt;',
                      '&lt;span class="priceOptions"&gt;',
                      '&lt;tpl for="prices"&gt;',
                          '&lt;span class="priceOptionReg"&gt;',
                              '&lt;tpl if="priceOptionDesc"&gt;{priceOptionDesc}&lt;/tpl&gt; ',
                              '&lt;tpl if="priceOptionReg"&gt;{priceOptionReg}&lt;/tpl&gt;  ',
                              '&lt;tpl if="priceReg"&gt;${priceReg}&lt;/tpl&gt;  ',
                              '&lt;tpl if="priceRegSuffix"&gt;{priceRegSuffix}&lt;/tpl&gt; ',
                          '&lt;/span&gt;',
                          '&lt;tpl if="priceSale"&gt;&lt;span class="priceOptionSale"&gt;',
                              '&lt;tpl if="priceSaleDesc"&gt;{priceSaleDesc}&lt;/tpl&gt; ',
                              '&lt;tpl if="priceOptionSale"&gt;{priceOptionSale}&lt;/tpl&gt;  ',
                              '&lt;tpl if="priceSale"&gt;${priceSale}&lt;/tpl&gt;',
                              '&lt;tpl if="priceSaleSuffix"&gt;{priceSaleSuffix}&lt;/tpl&gt; ',
                          '&lt;/span&gt;&lt;/tpl&gt;',
                      '&lt;/tpl&gt;',
                      '&lt;/span&gt;',
                  '&lt;/span&gt;',
                  '&lt;div class="clear"&gt;&lt;/div&gt;'
              ),
  </code></pre>
  
  <p>The problem is <code>if/elseif</code> are both executed for each record. If I use <code>if/else</code> it gives error in console.</p>
  
  <pre><code>Uncaught SyntaxError: Unexpected token else 
  </code></pre>
  
  <p>You can see I have used </p>
  
  <p><code>'&lt;tpl if={isBanner} === true&gt;',</code></p>
  
  <p>I have also used</p>
  
  <pre><code>'&lt;tpl if={isBanner} == true&gt;',
  </code></pre>
  
  <p>I have also tried many varients like comparing numeric values instead of Boolean and using <code>&amp;gt;</code> or <code>&amp;lt;</code>. Also tried comparing String values. But with all variations, the <code>if/elseif</code> are both executing and <code>if/else</code> gives error.</p>
  
  <p>Any help is appreciated, I just need to change class for first record.</p>