1. #1
    Sencha User
    Join Date
    Nov 2012
    Posts
    3
    Vote Rating
    0
    msteudel is on a distinguished road

      0  

    Default new to nestedlist

    new to nestedlist


    I'm trying to alter the getting started app by supplying my own json feed. But I'm having trouble getting it to show up in the list.

    Here's my code:

    Code:
     launch: function() {
            Ext.create("Ext.tab.Panel", {
                fullscreen: true,
                tabBarPosition: 'bottom',
                items: [
                {
                    xtype: 'nestedlist',
                    title: 'Songs',
                    iconCls: 'star',
                    displayField: 'name',
    
                    store: {
                        type: 'tree',
                        fields: [ 'name'],
                        root: {
                            leaf: false
                        },
    
                        proxy: {
                            type: 'jsonp',
                            url: 'http://phpfakebook.com/songs/get_songs',
                            reader: {
                                type: 'json',
                                rootProperty: 'songs'
                            }
                        }
                    },
                    detailCard: {
                        xtype: 'panel',
                        scrollable: true,
                        styleHtmlContent: true
                    },
    
                    listeners: {
                        itemtap: function(nestedList, list, index, element, post) {
                            this.getDetailCard().setHtml(post.get('content'));
                        }
                    }
                        
                },
    Here's my json being returned. Now I'm not really sure if my json is correct ( ivalidated the raw json) but I'm unclear how to make it jsonp, so I just wrapped it in a song() function:

    Code:
    songs({"songs":[{"name":"Chereokee Shuffle","key":"A"},{"name":"Goldrush","key":"D"},{"name":"Big Mon","key":"G"}]})
    The feed from the sencha blog doesn't seem to have it's code wrapped in any function, i've tried it both ways but unable to get it to work. I'm sure it's something super simple ....

    Thanks, Mark

  2. #2
    Sencha Premium Member
    Join Date
    Feb 2012
    Location
    Berne, Switzerland
    Posts
    714
    Vote Rating
    42
    ingo.hefti has a spectacular aura about ingo.hefti has a spectacular aura about ingo.hefti has a spectacular aura about

      0  

    Default


    why JSONP? and why nestedlist? The data looks rather simple...

  3. #3
    Sencha User
    Join Date
    Nov 2012
    Posts
    3
    Vote Rating
    0
    msteudel is on a distinguished road

      0  

    Default


    It's mostly because I was just trying to futz with the getting started app. Start with something that's working and see if you can slowly change it to something you want to do.

    Beyond that, at some point the app will go out and grab new data from a web service, which is why I was using jsonp.

    As to nested list, again it was just because that's what the getting started app was using and I had that working. I would like to use a detail pane when I get farther down the road, but I'm guessing I can do that with a regular list too ...

  4. #4
    Sencha Premium Member
    Join Date
    Feb 2012
    Location
    Berne, Switzerland
    Posts
    714
    Vote Rating
    42
    ingo.hefti has a spectacular aura about ingo.hefti has a spectacular aura about ingo.hefti has a spectacular aura about

      0  

    Default


    I'm just asking because JSONP and nestedlists probably may make the initial learning curve a bit steep .. So you better start with something easier. Just my 2 cents.

    And BTW you can retrieve data with normal JSON too...

  5. #5
    Sencha User
    Join Date
    Nov 2012
    Posts
    3
    Vote Rating
    0
    msteudel is on a distinguished road

      0  

    Default


    I was curious in the getting stared example, the request type says jsonp, but it doesn't look like the data from the sencha blog is actually jsonp.

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