Results 1 to 2 of 2

Thread: Ajax Store not loading in XCode

  1. #1
    Sencha User
    Join Date
    Apr 2007
    Posts
    39
    Answers
    2

    Default Ajax Store not loading in XCode

    I have a store with a proxy type as 'ajax'. I'm loading the data from a data.json file. On Windows, everything works in Chrome as well as on Android emulator.

    On Mac, this works perfectly if I run it in Safari when I run the sencha server via 'sencha web start'.

    However, when I run this in XCode, the json file is not read. After a couple of days of tearing my hair out, it looks like the XCode build is in a temporary folder and the proxy url is not getting resolved to the correct file. At least that is my assumption.

    I ran the app in XCode and then tried to debug using Safari Developer (remote debug). In the console if I type Ext.getStore('storename').load(), the load success listener gives the third argument as 'false', which indicates that the store did not load (as per docs).

    My proxy url is a relative url to the app root so something like this - 'data/datafile.json'.

    If I set the url with a slash in the beginning like so '/data/datafile.json', I get an 'invalid resource' error in the Safari Developer console.

    Any suggestions as to how I can resolve this will be really helpful.

    Thanks in advance.

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379
    Answers
    3997

    Default

    This is likely because you are loading off the filesystem which will always return a http status code as zero which is treated as a load failure. Ext.Ajax is setup to work on a web server not the filesystem.
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

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
  •