1. #1
    Sencha User
    Join Date
    Apr 2013
    Location
    Hyderabad
    Posts
    18
    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
    310
    Answers
    59
    Vote Rating
    50
    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
    18
    Vote Rating
    1
    abhi.srinu is on a distinguished road

      0  

    Default


    Yup it worked.

    Thanks droessner.
    --
    Abhi

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