I have a json property that might be null, and I’d prefer to keep it that way for other reasons. When I include that property in an Ext.Template with ‘{myProp}’ it sometimes renders as the word “null” when I want it to render as an empty string.
{myProp:undef} only hunts for undefined, not null. What’s the best way to get this done given that I don’t want to modify my data to convert null to empty string, and I’d like, if possible, to keep this inside the template. Shoving a little javascript into the template would be okay, but I would just still like to be able to do myTemplate.apply(myData)
nl2br almost does it, but I need to not insert br tags in the event of newlines.
Can you just override undef?
Or you could add your own function if you don’t want to mess with Ext and bind that in the template instead.