1. #1
    Sencha User
    Join Date
    Nov 2011
    Posts
    4
    Vote Rating
    0
    andorraclaim is on a distinguished road

      0  

    Question Unanswered: Model + Scripttagproxy Store + List + Panel = nothing

    Unanswered: Model + Scripttagproxy Store + List + Panel = nothing


    Now that I have completed my app with jQuery Mobile I want to give Sencha Touch another try. I originally stopped working with Sencha in the middle of fall at this exact same problem.

    Here's the same of the JSON I am getting back with my server. I can see this is being loaded with Chrome's developer tools:
    Code:
    [{"nid":"702","node_title":"another test again","users_name":"andorraclaim123","users_uid":"179","node_data_field_description_field_description_value":"Buy my cat","node_type":"push","node_vid":"702","files_node_data_field_image_node_data_field_image_field_imag":"1313","files_node_data_field_image_node_data_field_image_field_imag_1":"1","files_node_data_field_image_node_data_field_image_field_imag_2":"a:11:{s:3:\"fid\";s:4:\"1313\";s:5:\"width\";i:150;s:6:\"height\";i:89;s:8:\"duration\";i:0;s:18:\"audio_bitrate_mode\";s:0:\"\";s:18:\"audio_channel_mode\";s:0:\"\";s:12:\"audio_format\";s:0:\"\";s:13:\"audio_bitrate\";i:0;s:17:\"audio_sample_rate\";i:0;s:3:\"alt\";s:0:\"\";s:5:\"title\";s:0:\"\";}"
    Setting up a model....
    Code:
    Ext.regModel('socializeModel', {    fields: [
                 { name: 'nid', type: 'string' }, //just getting the first two values
                 { name: 'node_title', type: 'string' }
    ]
    });
    Now let's get the JSON....
    Code:
    var socializeStore = new Ext.data.Store({
       model: 'socializeModel',
       storeId: 'socializeStore',    
         fields: [
            'nid', 
            'node_title'
            ],
        proxy: {
            type: 'scripttag',
            url: 'http://example.com/services/frontpage.json',
            startParam: 'stcCallback1001',
            reader: {
                type: 'json',
                    }
            }
        });
    
    socializeStore.load();
    Now let's make a list and insert it into a card panel
    Code:
        
    App.views.socialize = new Ext.List({        fullscreen: true,
            store: 'socializeStore',
            id: 'socialize',
            itemTpl: '{nid}'
        });
    
    //start main panel
        App.views.Socializecard = Ext.extend(Ext.Panel, {
     
            title: "Socialize",
            iconCls: "action",
            styleHtmlContent: true,
            initComponent: function() {
                Ext.apply(this, {
                    dockedItems: [
                        topbar,
                        App.views.socialize
                        ]
                    });
                 App.views.Socializecard.superclass.initComponent.apply(this, arguments);
            }
        });
        Ext.reg('socializecard', App.views.Socializecard);
    })();
    All I get is the loading animation tho. My jQuery Mobile app works fine with the same endpoints, requirements, etc. Can anyone provide me with some insight on anything or throw me a bone here? I really want to use Sencha Touch.

  2. #2
    Sencha User
    Join Date
    Nov 2011
    Posts
    4
    Vote Rating
    0
    andorraclaim is on a distinguished road

      0  

    Default Really?

    Really?


    25+ views and no response?

  3. #3
    Sencha User
    Join Date
    Oct 2011
    Location
    Pakistan
    Posts
    229
    Vote Rating
    1
    Answers
    10
    umr.ashrf is on a distinguished road

      0  

    Default


    Check out this example http://senchafiddle.com/#Pdxh5. It will definitely help you fix your problem.

  4. #4
    Sencha User
    Join Date
    Nov 2011
    Posts
    4
    Vote Rating
    0
    andorraclaim is on a distinguished road

      0  

    Default


    Quote Originally Posted by umr.ashrf View Post
    Check out this example http://senchafiddle.com/#Pdxh5. It will definitely help you fix your problem.
    Thanks but this does not 'definately' help me. This is a cross domain request, hence my use of 'scripttag' as the type and 'autoload' does not work for my purposes. The only remaining difference in implementations is the use of 'SF.proxy' which from my understanding is for use only with Sencha Fiddle. What were you trying to point out?

  5. #5
    Sencha User
    Join Date
    Oct 2011
    Location
    Pakistan
    Posts
    229
    Vote Rating
    1
    Answers
    10
    umr.ashrf is on a distinguished road

      0  

    Default


    The previous link had the bug and I didn't realize it. Please try http://senchafiddle.com/#O8vp8

    The SF.proxy is just for testing purposes there. You can use just the URL when you will need to deploy. Did you mean you can not use autoLoad: true?

Thread Participants: 1