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
    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