PDA

View Full Version : Ext.XTemplate conditional logic



zb197
22 Aug 2009, 6:32 PM
How can I do boolean AND conditional logic? The logic below is what I want but the syntax is wrong.
Thanks,
Zev.

,'<tpl if="(bubblePermissions & 8)==0">'

Animal
22 Aug 2009, 11:20 PM
XTemplates can be fiddly.

So what you should do is fiddle around on the Firebug console command line trying XTemplates out with immediate apply calls.

It works fine. I just used this with various values and it displayed what I expected.



new Ext.XTemplate('<tpl if="((value & 8)==0)">true</tpl><tpl if="((value & 8)!=0)">false</tpl>').apply({value: 1})