1. #1
    Sencha User
    Join Date
    Sep 2008
    Posts
    23
    Vote Rating
    0
    robertocarvajal is on a distinguished road

      0  

    Default 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:

    Code:
    tpl: {
    '<tpl>my template stuff <script>function test() { // some javascript }</script></tpl>'
    }
    the template loads like this

    Code:
    my template stuff <script>function test()
    even escaping the { like this \{ it doesn't work, does anyone has a clue how to escape { inside XTemplate?

    thanks!

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,927
    Vote Rating
    443
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    Have a look at the following:
    http://docs.sencha.com/ext-js/4-0/#!/api/Ext.XTemplate

    Functions are supported.

    Regards,
    Scott.

  3. #3
    Sencha User
    Join Date
    Jul 2007
    Location
    Sydney Australia
    Posts
    7
    Vote Rating
    3
    jamesmoey is on a distinguished road

      2  

    Default


    Try "{['{']}" and "{['}']}"

  4. #4
    Sencha User
    Join Date
    Sep 2008
    Posts
    23
    Vote Rating
    0
    robertocarvajal is on a distinguished road

      0  

    Default


    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!

  5. #5
    Ext JS Premium Member devtig's Avatar
    Join Date
    Jan 2010
    Location
    Rotterdam, The Netherlands
    Posts
    389
    Vote Rating
    13
    devtig will become famous soon enough

      0  

    Default


    Quote Originally Posted by jamesmoey View Post
    Try "{['{']}" and "{['}']}"
    I can confirm that this works.

    PS: I dont use functions in the template but just curly braces.

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi