1. #1
    Sencha User
    Join Date
    Apr 2013
    Location
    Hyderabad
    Posts
    24
    Vote Rating
    1
    abhi.srinu is on a distinguished road

      0  

    Default Answered: Functions in Extjs tpl?

    Answered: Functions in Extjs tpl?


    Hi,

    I have a panel with a tpl with the given code:

    Code:
     {
            xtype: 'panel',
            id: 'pnlUserItemDetails',
            tpl: Ext.create('Ext.XTemplate', 
                '{Id}<br>',                                
                '    <tpl foreach="guestProducts.raw.products">',
                '        <h3>{ProductName}<br></h2>',
                '        Purchased {Quantity} for {[this.getPricePaid(PricePaid)]} on {SaleDate}<hr>',
                '    </tpl>',
                                    
                {
                    getPricePaid: function(n) {
    
    
                        return '$ '+0;
                    },
                }
            ),
            autoScroll: true,
            title: ''
        }
    everything is fine except the getPricePaid function is not getting called

    if i replace
    Code:
     {[this.getPricePaid(PricePaid)]}
    with
    Code:
    {PricePaid}
    it gets printed correctly

    Can someone help me telling what am i doing wrong?

    Thanks in advance.
    --
    Abhi

  2. Try

    Code:
    {[this.getPricePaid(values.PricePaid)]}

  3. #2
    Touch Premium Member
    Join Date
    Feb 2011
    Location
    NJ
    Posts
    311
    Answers
    59
    Vote Rating
    52
    droessner is a jewel in the rough droessner is a jewel in the rough droessner is a jewel in the rough

      1  

    Default


    Try

    Code:
    {[this.getPricePaid(values.PricePaid)]}

  4. #3
    Sencha User
    Join Date
    Apr 2013
    Location
    Hyderabad
    Posts
    24
    Vote Rating
    1
    abhi.srinu is on a distinguished road

      0  

    Default


    Yup it worked.

    Thanks droessner.
    --
    Abhi

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