1. #1
    Sencha User
    Join Date
    Jun 2011
    Posts
    9
    Vote Rating
    0
    thiszparveen is on a distinguished road

      0  

    Default Unanswered: Adding condition to a tpl

    Unanswered: Adding condition to a tpl


    Hi,

    My requirement is to print "No" if the value of "test" is empty string. otherwise i need to print the value of test as it is.
    rently it is printing blank if the value of test is empty string. I wanted to print "No" instead.
    Cur
    How can I add that condition in tpl. Could some one help me out.

    var tpl = new Ext.XTemplate(
    "<table><tr><td>Test</td></tr><tr><td>{test}</td></tr></table>"
    );

    Thanks,

  2. #2
    Sencha User
    Join Date
    Dec 2009
    Location
    Enschede, The Netherlands
    Posts
    327
    Answers
    16
    Vote Rating
    13
    flanders will become famous soon enough

      0  

    Default


    Here is the documentation for XTemplate: http://docs.sencha.com/ext-js/4-1/#!/api/Ext.XTemplate

    This should do the trick:

    Code:
    <tpl if='test == \"\"'>No<tpl else>{test}</tpl>

Thread Participants: 1

Tags for this Thread

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