1. #1
    Sencha User
    Join Date
    May 2012
    Posts
    2
    Vote Rating
    0
    cw85 is on a distinguished road

      0  

    Default Answered: xml fields control and view

    Answered: xml fields control and view


    Hi, i'm working on a project that take an xml file and show the fields in a view.

    First problem: I've followed the "getting started" video and I've obtained a working code but in a list form (because in the video the author build a blog post list). How can I obtain the "showing" of data in a normal view (so not in a list)?

    Second problem: I want to have control of the xml fields. I want to control if one or more field that I show is empty and if so, I want to hide that field from the view. How can I obtain this? Are there any methods to call and in which way I can do that?

    Here is the code:
    Code:
    Ext.define("app.view.Cliente", {
    
           extend: 'Ext.navigation.View',
           xtype: 'daticliente',
           
           config: {
                    title: 'Dati Cliente',
                    iconCls: 'star',
                    
                    items: {
                            xtype: 'list',
                            
                            itemTpl: '<h1>{struttura}</h1>'+
                                        '<span>{email}</span><br />'+
                                        '<span>{url}</span>'+
                                        '<span>{longitudine}</span>',
                            
                            store: {
                                autoLoad: true,
                                fields: ['struttura', 'email', 'url', 'longitudine'],
                                
                                proxy: {
                                    type: 'ajax',
                                    url: 'http://www.test.com/xml',
                                    
                                    reader: {
                                        type: 'xml',
                                        record: 'data'
                                    }
                                }
                            }
                        }
                    }
                });
    Thank you for support,
    C.

  2. If you don't want to use a list you will need to get the data manually like looping through the store and get each record's data to build an array of objects or just one record. Then I would use a template and setData on the component.

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,754
    Answers
    3462
    Vote Rating
    827
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    If you don't want to use a list you will need to get the data manually like looping through the store and get each record's data to build an array of objects or just one record. Then I would use a template and setData on the component.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  4. #3
    Sencha User
    Join Date
    May 2012
    Posts
    2
    Vote Rating
    0
    cw85 is on a distinguished road

      0  

    Default


    Ok thank you for suggestion!

    C.

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