1. #1
    Sencha Premium Member
    Join Date
    Feb 2012
    Posts
    106
    Vote Rating
    0
    Answers
    4
    paulh1971 is on a distinguished road

      0  

    Default Answered: JsonP not populating list

    Answered: JsonP not populating list


    Hello all, I have scoured the forums for a solution for the JsonP not populating list problem I am having and from what I can tell everything is setup up properly, but something is not quite right.

    When using Ajax with a local .json file it works great, but when I change it over to JsonP the list is blank and there are no errors in the console.

    Here is my proxy info:
    Code:
    proxy: {            type: 'jsonp',
                url: 'http://domainiamusing.com/mobiledata/?callback=ShowsCallback',
               
                reader: {
                    type: 'json',
                    rootProperty: 'shows'
                }
            }
    Here is a sample of what is being returned when I view the url in a browser window.

    Code:
    ShowsCallback({"shows":{[{"usID":"258","usEventName":"Memphis","usEventType":"4","usEventStatus":"2","usEventOnSaleDateBegin":"9/24/2011 12:00:00 PM","usEventOnSaleDateEnd":"5/13/2012 11:30:00 PM","usEventDateBegin":"5/1/2012 12:00:00 AM","usEventDateEnd":"5/13/2012 11:30:00 PM","usEventBuyTicketsUrl":""}]} }
    This is just baffling me. Does anyone have any thoughts on what may be wrong?

    Thanks,
    Paul

  2. Please post questions to the relevant Q&A or Help forum. I would move this thread but you haven't said which framework/version you're using so I don't know where to move it.

    You shouldn't be specifying the name of the callback function in the URL. The framework will generate a unique function name for you and add it to the URL itself.

  3. #2
    Sencha Premium Member
    Join Date
    Feb 2012
    Posts
    106
    Vote Rating
    0
    Answers
    4
    paulh1971 is on a distinguished road

      0  

    Default


    Can anyone help me with this? Thanks!

  4. #3
    Sencha User skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,082
    Vote Rating
    112
    Answers
    454
    skirtle is a splendid one to behold skirtle is a splendid one to behold skirtle is a splendid one to behold skirtle is a splendid one to behold skirtle is a splendid one to behold skirtle is a splendid one to behold skirtle is a splendid one to behold

      0  

    Default


    Please post questions to the relevant Q&A or Help forum. I would move this thread but you haven't said which framework/version you're using so I don't know where to move it.

    You shouldn't be specifying the name of the callback function in the URL. The framework will generate a unique function name for you and add it to the URL itself.

  5. #4
    Sencha Premium Member
    Join Date
    Feb 2012
    Posts
    106
    Vote Rating
    0
    Answers
    4
    paulh1971 is on a distinguished road

      0  

    Default


    Hi skirtle,

    This is Sencha Touch 2.

    Thanks for your response to the problem. I removed the specification of the callback function in the URL. I also had to adjust a few things in my json file creation, and now it works great.

    Paul

  6. #5
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,657
    Vote Rating
    435
    Answers
    3109
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    Are you sure the callback function you have in your response is 100% what is sent as a parameter in your request?
    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.

  7. #6
    Sencha Premium Member
    Join Date
    Feb 2012
    Posts
    106
    Vote Rating
    0
    Answers
    4
    paulh1971 is on a distinguished road

      0  

    Default


    Yeah, it's working great now. Sorry, I should have closed this post.

Tags for this Thread