Results 1 to 3 of 3

Thread: Very long response while loading JSONP

  1. #1
    Sencha User
    Join Date
    Jul 2012
    Posts
    61
    Answers
    1
    Vote Rating
    0
      0  

    Default Unanswered: Very long response while loading JSONP

    I try to load store by using JSONP

    Code:
    var store = Ext.data.StoreManager.lookup('need_store');
    
    store.setProxy({
    	type: 'jsonp',
    	url: 'myurl'
    });
    
    store.load();
    JSON output like:

    Code:
    Mycallback([['name1', 'id1', 'price1'], ['name2', 'id2', 'price2']]
    I declare Mycallback function in index.html

    Code:
    <script type="text/javascript">
    	    ...	    
    	    function Mycallback(data) {
    	    	g_App.getController('MyController').Load(data);
        	}
        </script>
    MyController.Load

    Code:
    {
    return;
    }
    So I don't add items into store. But indicator "Loading..." shows about 5 seconds! Chrome debug says, GET url takes 65 ms. What's wrong?

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,411
    Answers
    3898
    Vote Rating
    1290
      0  

    Default

    The callback method name that should be returned in your response is automatically sent as a param in the request. You don't need to do anything client side, just use what is sent in your response.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    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 in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Jul 2012
    Posts
    61
    Answers
    1
    Vote Rating
    0
      0  

    Default

    I have invariable function name in JSON, and I must to declare my function in such way

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
  •