I'd also like to emphatically state that I didn't create that solution and I'm not responsible for any best practice violations that might be found therein...
Javascript function calls in template values causing crash
I've found a (the?) source of our Designer "TypeError: 'undefined' is not an object" crashes. We use grid templatecolumns similar to the one below throughout our projects:
It seems that Designer is trying to interpret the .toLowerCase() call when the class is rendered in the design view. Since we create and bind our stores in the code behinds (as opposed to stores created in the Designer) the data value would appear to be null at design time, causing the error.
I'd call this a Designer bug, but regardless, is there a better way to handle the template scenario I've given?
FIXED: I came up with a fix for this particular issue. Converting the values.ColumnName value to a string first and then converting toLowerCase results in a text string of "undefined" rather than chucking an undefined reference error. See below: