-
29 Feb 2012 4:09 AM #1
Answered: ST2 RC & Beta List and rendering issues
Answered: ST2 RC & Beta List and rendering issues
The following code snippets resides in the ST2 (RC & Beta) documentation.
The problem is as follows:- When using ST's RC version, the list doesn't work...and the interface renders fine.
- When using ST's Beta version, the list renders fine...but the interface breaks (tabBar goes to the top and becomes totally useless).
And the index.html ...Code:var list = Ext.create('Ext.DataView', { fullscreen: true, iconCls: 'favorites', cls: 'twitterView', store: { autoLoad: true, fields: ['from_user', 'text', 'profile_image_url'], proxy: { type: 'jsonp', url: 'http://search.twitter.com/search.json?q=Sencha Touch', reader: { type: 'json', root: 'results' } } }, itemTpl: '<img src="{profile_image_url}" /><h2>{from_user}...</h2><p>{text}</p><div style="clear: both"></div>' }); Ext.application({ name: 'MyApp', launch: function() { Ext.create('Ext.TabPanel', { fullscreen: true, tabBarPosition: 'bottom', defaults: { styleHtmlContent: true }, items: [ list, { title: 'Home', iconCls: 'home', html: 'Home Screen' }, { title: 'Contact', iconCls: 'user', html: 'Contact Screen' } ] }); } });
Am I doing anything wrong here? Or is this a bug (known issue maybe?)Code:!DOCTYPE html> <html> <head> <!-- RC --> <!-- <link rel="stylesheet" href="../sencha-2.rc/resources/css/sencha-touch.css" type="text/css"> <script type="text/javascript" src="../sencha-2.rc/builds/sencha-touch-all-debug.js"></script> --> <!-- BETA --> <link rel="stylesheet" href="../sencha-2.0/resources/css/sencha-touch.css" type="text/css"> <script type="text/javascript" src="../sencha-2.0/sencha-touch-all-debug.js"></script> <script type="text/javascript" src="listr.js"></script> <title>Next24</title> </head> <body></body> </html>
Please advise ...
Regards,
Riyaad
-
Best Answer Posted by riyaad
Hi Mitchell,
Thank you, I got it working. Strangest thing, it actually worked with root: 'results' as well as rootProperty: 'results. I did a clean install of both the SDK and ST2 on this machine (Win7) and believe the possible problem may be an incorrect version of the SDK against ST on my Mac hence not only this issue but some other inconsistent results. Guess you learn something new everyday
...
Will be testing this theory in the next few hours
Regards,
Riyaad
-
29 Feb 2012 9:19 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,582
- Vote Rating
- 434
- Answers
- 3102
It displays fine for me in beta3 and RC1/2. The only thing I do see is the root config in your reader config has been renamed to rootProperty.
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.
-
29 Feb 2012 10:14 AM #3
Hi Mitchell Simoens
I'm following the code on http://docs.sencha.com/touch/2-0/#!/api/Ext.dataview.DataView
The reader here clearly states ...
Are you saying thatCode:reader: { type: 'json', root: 'results' }
should work for both Beta3 and RC1/2?Code:reader: { type: 'json', rootProperty: 'results' // changes made here }
Regards
Riyaad
-
29 Feb 2012 10:58 AM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,582
- Vote Rating
- 434
- Answers
- 3102
What I said is that your code worked for me in beta3 and RC1/2 but the root config is renamed to rootProperty.
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.
-
29 Feb 2012 12:56 PM #5
Okay ...I got it.
Okay ...I got it.
Hi Mitchell,
Thank you, I got it working. Strangest thing, it actually worked with root: 'results' as well as rootProperty: 'results. I did a clean install of both the SDK and ST2 on this machine (Win7) and believe the possible problem may be an incorrect version of the SDK against ST on my Mac hence not only this issue but some other inconsistent results. Guess you learn something new everyday
...
Will be testing this theory in the next few hours
Regards,
Riyaad
-
29 Feb 2012 1:03 PM #6Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,582
- Vote Rating
- 434
- Answers
- 3102
I didn't think the root->rootProperty change would affect anything as it worked for me both ways. I would be interested in hearing if you figure out if there was an issue somewhere.
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.
-
1 Mar 2012 3:10 AM #7
Sorted ...
Sorted ...
I reinstalled with the newer SDK & ST libraries (both on Mac & Win7)
This seem to have resolved the issue ... the list works now


Reply With Quote