Results 1 to 7 of 7

Thread: ST2 RC & Beta List and rendering issues

  1. #1
    Sencha User riyaad's Avatar
    Join Date
    Jul 2011
    Location
    Cape Town
    Posts
    245
    Answers
    6
    Vote Rating
    2
      0  

    Default Answered: ST2 RC & Beta List and rendering issues

    The following code snippets resides in the ST2 (RC & Beta) documentation.

    The problem is as follows:
    1. When using ST's RC version, the list doesn't work...and the interface renders fine.
    2. When using ST's Beta version, the list renders fine...but the interface breaks (tabBar goes to the top and becomes totally useless).
    My code is as follows...

    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'
                    }
                ]
            });
        }
    });
    And the index.html ...

    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>
    Am I doing anything wrong here? Or is this a bug (known issue maybe?)

    Please advise ...

    Regards,
    Riyaad

  2. 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

  3. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3932
    Vote Rating
    1272
      0  

    Default

    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 @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

  4. #3
    Sencha User riyaad's Avatar
    Join Date
    Jul 2011
    Location
    Cape Town
    Posts
    245
    Answers
    6
    Vote Rating
    2
      0  

    Default

    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 ...

    Code:
    reader: {
                    type: 'json',
                    root: 'results'
                }
    Are you saying that

    Code:
    reader: {
                    type: 'json',
                    rootProperty: 'results' // changes made here
                }
    should work for both Beta3 and RC1/2?

    Regards
    Riyaad

  5. #4
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3932
    Vote Rating
    1272
      0  

    Default

    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 @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

  6. #5
    Sencha User riyaad's Avatar
    Join Date
    Jul 2011
    Location
    Cape Town
    Posts
    245
    Answers
    6
    Vote Rating
    2
      0  

    Default 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

  7. #6
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3932
    Vote Rating
    1272
      0  

    Default

    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 @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

  8. #7
    Sencha User riyaad's Avatar
    Join Date
    Jul 2011
    Location
    Cape Town
    Posts
    245
    Answers
    6
    Vote Rating
    2
      0  

    Default Sorted ...

    I reinstalled with the newer SDK & ST libraries (both on Mac & Win7)
    This seem to have resolved the issue ... the list works now

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
  •