Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User
    Join Date
    Aug 2012
    Posts
    15
    Vote Rating
    0
    svper is on a distinguished road

      0  

    Default Unanswered: Array Length in XTemplate

    Unanswered: Array Length in XTemplate


    Hi,
    I'm trying to display something if an array is empty in an Xtemplate.

    My code:

    Code:
    '<tr><td class="pendingDocsSignedTableTitle">Signed By:</td></tr>' +                                    
                                        '<tpl if="signedUsers.length == 0">',
                                             '<tr><td class="pendingDocsSignedTableUser">No users signed</td></tr>',
                                         '</tpl>',
                                         
                                         '<tpl for="signedusers">',
                                             '<tpl if="xcount &gt; 0">',
                                                '<tr><td class="pendingDocsSignedTableUser">{sn} - {[this.formatFDate(values.d)]} </td></tr>',
                                             '</tpl>',
                                         '</tpl>',

    BBUT the

    Code:
     '<tpl if="signedUsers.length == 0">',
                                             '<tr><td class="pendingDocsSignedTableUser">No users signed</td></tr>',
                                         '</tpl>',
    part does not seem to work. Anybody have an idea on how to do this ?

  2. #2
    Sencha User
    Join Date
    May 2011
    Location
    Ukraine, Rivne
    Posts
    247
    Answers
    44
    Vote Rating
    42
    redraid has a spectacular aura about redraid has a spectacular aura about redraid has a spectacular aura about

      0  

    Default


    This because signedUsers key undefined, check for undefined to:
    Code:
    '<tpl if="values.signedUsers == undefined || values.signedUsers.length == 0">'
    demo: http://jsfiddle.net/rJFYS/1/

  3. #3
    Sencha User
    Join Date
    Aug 2012
    Posts
    15
    Vote Rating
    0
    svper is on a distinguished road

      0  

    Default


    Thanks for the response... but i just found out why it wouldn't work... and i feel like an .

    i used signedUsers where signedusers is the right one.

    Ty javascript for not throwing decent errors on capitalization


    Sorry for your time

  4. #4
    Sencha User
    Join Date
    May 2011
    Location
    Ukraine, Rivne
    Posts
    247
    Answers
    44
    Vote Rating
    42
    redraid has a spectacular aura about redraid has a spectacular aura about redraid has a spectacular aura about

      0  

    Default


    No problem)
    //wbr

Thread Participants: 1

Tags for this Thread