Results 1 to 2 of 2

Thread: Simple question on getting JSON data through REST using

  1. #1
    Sencha User
    Join Date
    Jul 2012
    Vote Rating

    Default Simple question on getting JSON data through REST using

    newbie here - be warned.

    I took the array-grid.html/array-grid.js example from

    I then put the same data into a MongoDB database, using mongodb-rest for access, and a URL like this:


    [{"_id":"4ffcfaf0f2c5dcf7569e4e3a","name":"Monkey D Luffy","position":"Captain","ambition":"I will become the pirate king"},{"_id":"4ffcfaf0f2c5dcf7569e4e3b","name":"Roronoa Zoro","position":"Swordman","ambition":"Become the greatest swordman"},{"_id":"4ffcfaf0f2c5dcf7569e4e3c","name":"Sanji","position":"Cook","ambition":"Find all blue"},{"_id":"4ffcfaf0f2c5dcf7569e4e3d","name":"Usopp","position":"Sniper","ambition":"Become the greatest warrior"},{"_id":"4ffcfaf0f2c5dcf7569e4e3e","name":"Nami","position":"Navigator","ambition":"Draw map of the world"}]

    so, if I modify the sample code to look like:

    var store = Ext.create('', {
    fields: [
    // data: sampleData
    url: '',

    then add a:


    should that give the equivalent output? It basically gives an empty grid. Not sure where to start debugging - whether it's in the code, whether the URL get doesn't work, etc.

    again, sorry for the probably obvious problems - just trying to get a feeling of whether this seems like a framework to give some programmer newcomers access to our MongoDB store or not.

  2. #2
    Sencha User evant's Avatar
    Join Date
    Apr 2007
    Sydney, Australia
    Vote Rating


    Two things:

    1) Verify the request works by looking at the network traffic in the chrome dev tools or firebug. Do you see the appropriate data coming back?

    2) ArrayStore is not what you want. From the docs:

    An ArrayStore will be automatically configured with a
    If you look at that page,!...a.reader.Array, you'll see the data isn't in the correct format.

    Instead, you would use:!
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

Posting Permissions

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