PDA

View Full Version : Escape square brackets in ExtJS template markup (XTemplate)?



cbj4074
13 Mar 2013, 8:38 AM
Is it possible to escape square brackets within XTemplate markup? Certain JavaScript structures require the use of square brackets when accessing the object's properties (such as when an object property's name contains a dash [minus sign] character), e.g.:



raw.cmsInstances[\'cms-thumb\'].url


When I attempt to use this syntax within XTemplate markup, the tokens between the square brackets are treated as an expression and are not rendered literally.

Thanks for any help with this!

cbj4074
13 Mar 2013, 10:44 AM
I asked the same question on another site and the short answer is that using square bracket notation in XTemplate markup is not supported at the moment. Additionally, the individual created a feature request to allow for its use.

http://stackoverflow.com/questions/15389869/escape-square-brackets-in-extjs-template-markup-xtemplate