Results 1 to 3 of 3

Thread: Problem with stores and loading lists.

  1. #1
    Sencha User
    Join Date
    Jun 2012
    Posts
    1
    Vote Rating
    0
      0  

    Default 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
      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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3932
    Vote Rating
    1272
      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 @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •