-
9 May 2012 9:30 PM #1
Problem with Ext.XTemplate escaping javascript functions
Problem with Ext.XTemplate escaping javascript functions
I have a xtpl config that needs to include some custom javascript, so I'm doing something like this:
the template loads like thisCode:tpl: { '<tpl>my template stuff <script>function test() { // some javascript }</script></tpl>' }
even escaping the { like this \{ it doesn't work, does anyone has a clue how to escape { inside XTemplate?Code:my template stuff <script>function test()
thanks!
-
16 May 2012 6:56 AM #2
Have a look at the following:
http://docs.sencha.com/ext-js/4-0/#!/api/Ext.XTemplate
Functions are supported.
Regards,
Scott.
-
6 Jun 2012 10:40 PM #3
Try "{['{']}" and "{['}']}"
-
8 Jun 2012 8:33 AM #4
I realized it's nonsense to embed JS in a template since functions are supported and since you can load external JS too, I was just trying to use some custom code for a html5 player and got surprised it just didn't work right away, thanks for the help!


Reply With Quote