简体   繁体   中英

tpl inside of Items[] on Sencha Touch 2

I am trying to add this code in Sencha Touch, but it´s not working..

        items: [
        {
            xtype: 'label',
            tpl: ['<div class="label">{[c.Text.getText("SC_ORDER_A_TOTAL_NET_AMOUNT")]} </div>'    +
                '<div class="total-value">{netamount}</div>' +
                '<div class="indicator {lightstatus}">{lightvalue}</div>'].join()
        }
    ]

Maybe, it´s not possible to do this.. any clue? I need to configure different labels with different hidden option, sometimes it´s true and sometimes it´s false.

This is working for me:

{
    xtype: 'label',
    tpl: '<tpl if="doShow"><div style="color:red;">It is raining {textFromData}</div></tpl>',
    data: {textFromData:'Cats and Dogs'}
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM