PDA

View Full Version : Did XTemplate processing of "if" change between 4.1.x and 4.2.x?



Jangla
20 Mar 2015, 3:29 AM
I'm in the process of trying to update an enterprise scale app that uses 4.1.1

In the existing XTemplates, we often use an if statement to check for the presence of an attribute on the model:



<tpl if="campaign && campaign.name"> \
<span class="meta-detail text-lowercase" data-icon="O">{campaign.name}</span>\
</tpl>\


In the above, if "campaign" doesn't exist, the template would not render the enclosed HTML.

In 4.2.2, this same template reports:


XTemplate Error: campaign is not defined

Gary Schlosberg
26 Mar 2015, 1:18 PM
I don't know of a change like that. It seems to work in whichever 4.x version I try:
https://fiddle.sencha.com/#fiddle/kbu

Perhaps you need to look at something that changed your data?