1. #1
    Sencha User
    Join Date
    Jul 2008
    Location
    Brooklyn NY
    Posts
    120
    Vote Rating
    0
    tBSTAR is on a distinguished road

      0  

    Post Json and XTemplate question

    Json and XTemplate question


    Hi,

    I generate my json dynamically and if my object has empty fields, it will ignore them and therefore reducing the amount of text sent back to the client. Now, I get stuck when I am creating an Xtemplate because I wouldn't know if those properties exist or not and my question is: Is there a way to check before hand if they exist?
    This is my Json:
    Code:
    "DependentInformation":{
    "Header":"Dependent Information",
    "Name":"JANE  DOE",
    "ID":"YLN0000002",
    "DOB":"01/06/1978"
    }
    This is my JS:
    Code:
    var tpl2 = new Ext.XTemplate(
                                '<div class="session-hd">',
                                    '<tpl if="this.isEmpty(Name)== false">',
                                        '<p>Name: {Name}</p>',
                                    '</tpl>',
                                    '<tpl if="this.isEmpty(ID) == false">',
                                        '<p>ID: {ID}</p>',
                                    '</tpl>',
                                    '<tpl if="this.isEmpty(Address)== false">',
                                    '<p>Address: {Address}</p>',
                                    '<tpl if="this.isEmpty(CSZ)== false">',
                                    '<p>{CSZ}</p>',
                                    '</tpl>',
                                    '<tpl if="this.isEmpty(Date)== false">',
                                        '<p>{Date}</p>',
                                    '</tpl>',
                                '</div>', {
                                 isEmpty: function(value){
                                     if (value=='null')
                                     return true
                                     else return false
                                 }}
                                );
    Thank you

  2. #2

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