1. #1
    Sencha User
    Join Date
    Jun 2012
    Posts
    1
    Vote Rating
    0
    th3dj is on a distinguished road

      0  

    Default Unanswered: Problem with stores and loading lists.

    Unanswered: Problem with stores and loading lists.


    I have been at it for a bit and am having a few issues that i cant figure out. I am trying to load a simple list in from a jsonp file and am having trouble getting my list to display. I got it to load the php script but am unable to get it to render what it pulled from my server.


    The script to display results.:
    Code:
    Ext.define('beef.view.outbound', {
        extend: 'Ext.navigation.View',
        xtype: 'outboundpanel',
            config: {
                title: 'Outbound Trucks',
                iconCls: 'star',
                
                
                items: [
                    {
                        xtype: 'nestedlist',
                        title: 'Outbound Trucks',
                        iconCls: 'star',
                        displayField: 'time',
                        autoLoad: 'true',
                        store: {
                            type: 'tree',
                            
                            fields: [
                                'truck', 'time',
                                {name: 'leaf', defaultValue: true}
                            ],
                            root: {
                                leaf: false
                            },
                                proxy: {
                                    type: 'jsonp',
                                    url: 'my url',
                                    reader: {
                                        type: 'json',
                                        rootProperty: 'entry'
                                    }
                            }
                        }
                    }
                ]
            }
    });

    Here's the output of my php script.:
    Code:
    [{"entry":{"time":"1","truck":"1"}},{"entry":{"time":"2","truck":"2"}}]
    I have no clue where to find my screw up. At this moment I'm at a loss for ideas.

  2. #2
    Sencha Premium Member
    Join Date
    May 2011
    Posts
    71
    Answers
    5
    Vote Rating
    6
    cyee is on a distinguished road

      0  

    Default


    Have you verified the store is created successfully? Have you verified that any data is loaded?

    You have an autoLoad config param on your list. Shouldn't that be on the store?

  3. #3
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,408
    Answers
    3549
    Vote Rating
    851
    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


    And the response you give is not valid JSONP, it just JSON. JSONP is JSON wrapped in a callback method whose name is sent as a parameter in the request.
    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.

Thread Participants: 2

Tags for this Thread