1. #1
    Sencha User
    Join Date
    Jul 2012
    Posts
    38
    Answers
    1
    Vote Rating
    0
    indapublic is on a distinguished road

      0  

    Default Unanswered: Very long response while loading JSONP

    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 - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,522
    Answers
    3447
    Vote Rating
    814
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      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 @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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
    38
    Answers
    1
    Vote Rating
    0
    indapublic is on a distinguished road

      0  

    Default


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

Thread Participants: 1

Tags for this Thread