1. #1
    Ext User
    Join Date
    Mar 2007
    Posts
    3
    Vote Rating
    0
    pcbender is on a distinguished road

      0  

    Default Compiled Templates not working as expected

    Compiled Templates not working as expected


    The following code works:

    var spec = {
    tag: 'div',
    style: 'width:100%;border:1px solid blue;',
    cls: 'wtf',
    children: [{
    tag: 'a',
    href: '{0}',
    children: [{
    tag: 'span',
    html: '{1}'
    }]
    }]
    };
    var template = YAHOO.ext.DomHelper.createTemplate(spec);
    template.compile();
    var el = template.append(divToolbar, ['http://www.google.com', 'boo']);

    However, this does not:

    var spec = {
    tag: 'div',
    style: 'width:100%;border:1px solid blue;',
    cls: 'wtf',
    children: [{
    tag: 'a',
    href: '{myurl}',
    children: [{
    tag: 'span',
    html: '{mytext}'
    }]
    }]
    };
    var template = YAHOO.ext.DomHelper.createTemplate(spec);
    template.compile();
    var el = template.append(divToolbar,
    [
    {'myurl' : 'http://www.google.com', 'mytext' : 'boo'}
    ]
    );

    The problem is in the generated code:

    this.compiled = function(values){ return '<div><span>' + values[mytext] + '</span></div>';};

    As you can see, the myurl reference should be 'myurl'. Same for mytext.

    Also not sure if that syntax should work. Shouldn't the gen'd code look something like:

    values['children'][0]['myurl']

    Anyway.

    Thanks.

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

      0  

    Default


    There's a patch in this thread that does actually as you described.

    http://www.jackslocum.com/forum/viewtopic.php?t=266

  3. #3
    Ext User
    Join Date
    Mar 2007
    Posts
    3
    Vote Rating
    0
    pcbender is on a distinguished road

      0  

    Default Shuda Searched First...

    Shuda Searched First...


    Thanks for the info. I'm still not sure, even with using the ordinal approach, how you would specify multiple children's values. Again back to your example, how would you specify more than one link (a tag) as a child of the parent div?

    Thanks,

    PC

  4. #4
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    Tampa, FL
    Posts
    6,955
    Vote Rating
    16
    jack.slocum will become famous soon enough

      0  

    Default


    The template would be the child (a), without the parent.

  5. #5
    Ext User
    Join Date
    Mar 2007
    Posts
    3
    Vote Rating
    0
    pcbender is on a distinguished road

      0  

    Default THanks

    THanks


    Great work. Using the library for a project now. Donations on their way.

    PC

  6. #6
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    Tampa, FL
    Posts
    6,955
    Vote Rating
    16
    jack.slocum will become famous soon enough

      0  

    Default


    That sounds great to me.

Similar Threads

  1. TreeEditor.ignoreNoChange not working as expected
    By Jonathan Feinberg in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 21 Mar 2007, 1:22 PM
  2. Is CompositeElementLite working as expected
    By gordon in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 28 Feb 2007, 8:54 AM
  3. 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
  4. Dom Helper Named Parameters in Compiled Templates
    By ojintoad in forum Ext 1.x: Help & Discussion
    Replies: 1
    Last Post: 18 Oct 2006, 9:52 AM

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar