1. #1
    Sencha Premium Member
    Join Date
    Mar 2007
    Vote Rating
    ojintoad is on a distinguished road


    Default Dom Helper Named Parameters in Compiled Templates

    Dom Helper Named Parameters in Compiled Templates

    Do named parameters work with compiled dom templates? I've run the examples using named parameters and included the additional .compile statement but it complains that the parameters aren't defined (for your blog post one, it specifically says id is not defined, which is the first parameter). If you turn off the compile function everything runs smoothly. Using numbered parameters works fine. I ask because the blog post doesn't say that the compiled ones don't support it. It breaks in both IE and Firefox.

    If it does support it, I'll post some code to see if it's something I'm doing wrong.

  2. #2
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Tampa, FL
    Vote Rating
    jack.slocum will become famous soon enough jack.slocum will become famous soon enough



    Named parameters were added as an afterthought and support for them wasn't added to compiled templates (my mistake). Here's a patch that fixes them:

    YAHOO.ext.DomHelper.Template.prototype.compile = function(){
            var html = this.html;
            var re = /\{(\w+)\}/g;
            var body = [];
            body.push("this.compiled = function(values){ return ");
            var result;
            var lastMatchEnd = 0;
            while ((result = re.exec(html)) != null){
                body.push("'", html.substring(lastMatchEnd, result.index), "' + ");
                body.push("values['", html.substring(result.index+1,re.lastIndex-1), "'] + ");
                lastMatchEnd = re.lastIndex;
            body.push("'", html.substr(lastMatchEnd), "';};");
    This will be part of the next release.

Similar Threads

  1. DomHelper Templates not working in IE
    By corey.gilmore in forum Ext 1.x: Help & Discussion
    Replies: 7
    Last Post: 8 Feb 2007, 10:03 PM
  2. [solved] how to use the dom helper ???
    By cobalt in forum Ext 1.x: Help & Discussion
    Replies: 2
    Last Post: 14 Nov 2006, 9:05 AM
  3. Compiled Templates not working as expected
    By pcbender in forum Ext 1.x: Bugs
    Replies: 5
    Last Post: 20 Oct 2006, 1:08 PM
  4. Dom Helper Reserved Word Hack
    By ojintoad in forum Ext 1.x: Help & Discussion
    Replies: 3
    Last Post: 17 Oct 2006, 12:22 PM

Thread Participants: 1

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