Results 1 to 4 of 4

Thread: help with Car Listing starter application

  1. #1
    Sencha User
    Join Date
    Mar 2013
    Posts
    1
    Vote Rating
    0
      0  

    Default help with Car Listing starter application

    I am stuck at the step where I load the data file in the CarDataStore store. I set the url on property on the data proxy like as instructed. data/cars.json. Previously I extracted the sample data download to C:\inetpub\wwwroot\CarListings\data as instructed.

    The error message is:

    Unable to load data using the supplied configuration.
    Open in Browser:
    data/cars.json.

    Preview for the app works ok, so the webserver is running ok. No car data shows in the Grid, but not surprising.

    Thanks in advance.

  2. #2
    Sencha User aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,488
    Vote Rating
    147
      0  

    Default

    Guessing you have not registered the JSON mime type with IIS
    http://stackoverflow.com/questions/3...s-inc-post-get
    Aaron Conran
    @aconran

  3. #3
    Sencha User
    Join Date
    Jun 2014
    Posts
    1
    Vote Rating
    0
      0  

    Default

    I had this problem and was able to fix it by setting the "root" property to "data".

    Ext.define('CarListings.store.CarDataStore', {
    extend: 'Ext.data.Store',


    requires: [
    'CarListings.model.CarData'
    ],


    constructor: function(cfg) {
    var me = this;
    cfg = cfg || {};
    me.callParent([Ext.apply({
    autoLoad: true,
    model: 'CarListings.model.CarData',
    storeId: 'MyJsonStore',
    proxy: {
    type: 'ajax',
    url: 'data/cars.json',
    reader: {
    type: 'json',
    root: 'data'
    }
    }
    }, cfg)]);
    }
    });

  4. #4
    Sencha User
    Join Date
    Jun 2013
    Posts
    13
    Vote Rating
    1
      0  

    Default

    I have the same problem with the CarListing sample app: "unable to load data" but the "view cars.json" link shows the data. I have checked the web.xml files and I believe JSON data is defined. I saw the previous response, which shows adding "root: 'data'" to the reader under the proxy. HOW do I do that? I have Sencha Architect 3.2 up and running, but as a complete newbie I cannot find any way to add that property at that point. I tried entering this: "root: data" in the filter window, when the cursor was in the proxy section, and it looks ALMOST like the above, EXCEPT it calls the property "rootProperty" rather than "root" (despite my typing "root"). So my code now looks like this: Ext.define('CarListings.store.CarDataStore', { extend: 'Ext.data.Store', requires: [ 'Ext.data.proxy.Ajax', 'Ext.data.reader.Json' ], constructor: function(cfg) { var me = this; cfg = cfg || {}; me.callParent([Ext.apply({ storeId: 'CarDataStore', proxy: { type: 'ajax', url: 'data/cars.json', reader: { type: 'json', rootProperty: 'data' } } }, cfg)]); } }); == Unfortunately, it still doesn't load the data when I right-click the store and select "Load Data". I still get the "unable to load data using the supplied configuration." message. Any suggestions?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •