-
3 Feb 2013 1:55 AM #1
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.:
I have no clue where to find my screw up. At this moment I'm at a loss for ideas.Code:[{"entry":{"time":"1","truck":"1"}},{"entry":{"time":"2","truck":"2"}}]
-
4 Feb 2013 8:33 AM #2
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?
-
4 Feb 2013 1:59 PM #3Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 436
- Answers
- 3113
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
________________
http://www.JSONPLint.com - Source to lint your JSONP!
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 almost in print!
When posting code, please use BBCode's CODE tags.


Reply With Quote